CSP frame-ancestors restriction
Restricts which parent documents may embed a page in a frame.
Support in current browsers
Checked against the current browser versions recorded in MDN browser data 8.1.5.
| Browser | Minimum | Outcome | Reason |
|---|---|---|---|
| Chrome | 155 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Edge | 154 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Firefox | 157 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Safari | 27 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Chrome for Android | 155 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Firefox for Android | 157 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Safari on iOS | 27 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Android WebView | 155 | Works | Every required mapped BCD feature is available without a recorded qualification. |
| Samsung Internet | 30.0 | Works | Every required mapped BCD feature is available without a recorded qualification. |
How support changed
Each segment groups recorded releases with the same result. Gaps between recorded versions are not filled in. This is support at each release, rather than the planner’s check of every release above a minimum.
Chrome
http.headers.Content-Security-Policy.frame-ancestors- 1 – 3939 recorded releasesNot supported
- 40 – 155115 recorded releasesWorks
Edge
http.headers.Content-Security-Policy.frame-ancestors- 12 – 143 recorded releasesNot supported
- 15 – 15479 recorded releasesWorks
Firefox
http.headers.Content-Security-Policy.frame-ancestors- 1 – 3235 recorded releasesNot supported
- Partial implementation
- Before Firefox 58, <code>frame-ancestors</code> is ignored in <code>Content-Security-Policy-Report-Only</code>.
- 33 – 5725 recorded releasesWorks with limits
- Partial implementation
- Before Firefox 58, <code>frame-ancestors</code> is ignored in <code>Content-Security-Policy-Report-Only</code>.
- 58 – 157100 recorded releasesWorks
Safari
http.headers.Content-Security-Policy.frame-ancestors- 1 – 9.115 recorded releasesNot supported
- 10 – 2746 recorded releasesWorks
Chrome for Android
http.headers.Content-Security-Policy.frame-ancestors- 18 – 3916 recorded releasesNot supported
- 40 – 155115 recorded releasesWorks
Firefox for Android
http.headers.Content-Security-Policy.frame-ancestors- 4 – 3226 recorded releasesNot supported
- Partial implementation
- Before Firefox for Android 58, <code>frame-ancestors</code> is ignored in <code>Content-Security-Policy-Report-Only</code>.
- 33 – 5725 recorded releasesWorks with limits
- Partial implementation
- Before Firefox for Android 58, <code>frame-ancestors</code> is ignored in <code>Content-Security-Policy-Report-Only</code>.
- 58 – 15790 recorded releasesWorks
Safari on iOS
http.headers.Content-Security-Policy.frame-ancestors- 1 – 911 recorded releasesNot supported
- 9.3 – 2747 recorded releasesWorks
Android WebView
http.headers.Content-Security-Policy.frame-ancestors- 1 – 3911 recorded releasesNot supported
- 40 – 155115 recorded releasesWorks
Samsung Internet
http.headers.Content-Security-Policy.frame-ancestors- 1.0 – 3.27 recorded releasesNot supported
- 4.0 – 30.045 recorded releasesWorks
BCD 8.1.5 · catalogue 2.3.0. Source corrections can change this trace without a new browser release.
What this feature can and cannot do
Helps protect against
- Clickjacking
- Unapproved cross-origin embedding
Does not guarantee
- Same-origin UI redressing
- Pop-up windows
- Application authorisation
What you need before using it
- An explicit inventory of permitted embedding origins
Fallback to keep in place
Retain application-level anti-framing design and legacy X-Frame-Options where needed.