coderef

Permissions policyLimited availability

The Permissions-Policy response header and the allow attribute for <iframe> elements sets whether a policy-controlled feature, such as an API, may be used in a document.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–107Not supported
108+Supportedsince Nov 29, 2022
Current: 155
Edge
12–107Not supported
108+Supportedsince Dec 5, 2022
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–107Not supported
108+Supportedsince Nov 29, 2022
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, 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: allow.

Feature detection

JS · check before using
if ("HTMLIFrameElement" in globalThis && "allow" in HTMLIFrameElement.prototype) {
  // HTMLIFrameElement.allow is available
}

Sub-features

Support for each part of the feature (4). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
HTMLIFrameElement.allow60797411.1607911.3
iframe.allow60797411.1607911.3
http.headers.Permissions-Policy8585✕✕85✕✕
http.headers.Permissions-Policy.wildcards108108✕✕108✕✕