Permissions-Policy
The Permissions-Policy
header defines whether particular browser functions, in this case Web Monetization, are allowed within its own frame or within any iframe
elements in the document.
The basic syntax is as follows:
Permissions-Policy: <directive> <allowlist></allowlist></directive>
<directive>
is the function that is enabled for a given <allowlist>
, which is a list of origins. The default <allowlist>
is 'self'
, which allows monetization in the document and in all nested browsing contexts(iframes) in the same origin.
Directives
Controls whether the current document is allowed to use the Web Monetization API.
Note
The allow
attributes only take effect when the content navigable of the iframe is navigated. Adding or removing the monetization attribute has no effect on an already-loaded document.
Example
Permissions-Policy: monetization=(self)
Specifications
Specification |
---|
Web Monetization API #permissions-policy |
Browser compatibility
desktop | mobile | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on iOS | Samsung Internet | Puma Browser | |
monetization | Yes | Yes | Yes | No | Yes | No | No | No | No | No | No | No | Yes |
- Full Support
- No Support
- You'll need to use a Web Monetization Extension