<fencedframe>Limited availability
The <fencedframe> element embeds another HTML page into the current page in a more secure and privacy-preserving way than <iframe> elements.
Not yet supported in all major browsers — check the table and provide a fallback.
Discouraged: Following the announcement that Chrome will maintain its current approach to third-party cookies, Chrome decided to withdraw certain Privacy Sandbox features including the <fencedframe> element and related APIs.
Browser support
How to use
Not supported in Chrome, Edge, Firefox, Safari, Chrome Android, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: Fence.
Feature detection
const el = document.createElement("fencedframe");
if (!(el instanceof HTMLUnknownElement)) {
// <fencedframe> is supported
}Sub-features
Support for each part of the feature (21). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Fence | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| Fence.getNestedConfigs | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| Fence.reportEvent | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| Fence.setReportEventDataForAutomaticBeacons | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| FencedFrameConfig | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| FencedFrameConfig.setSharedStorageContext | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| HTMLFencedFrameElement | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| HTMLFencedFrameElement.allow | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| HTMLFencedFrameElement.config | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| HTMLFencedFrameElement.height | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| HTMLFencedFrameElement.sandbox | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| HTMLFencedFrameElement.width | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| Navigator.deprecatedReplaceInURN | 128 | 128 | ✕ | ✕ | 128 | ✕ | ✕ |
| Window.fence | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| a.target.unfencedTop | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| fencedframe | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| fencedframe.allow | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| fencedframe.height | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| fencedframe.width | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| http.headers.Content-Security-Policy.fenced-frame-src | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
Show 1 more
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| http.headers.Sec-Fetch-Dest.fencedframe | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |