0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Sets an iframe's Permissions Policy: which powerful features (camera, microphone, fullscreen, payment, geolocation) the embedded document may use.
Overview
The allowattribute sets the Permissions Policy for an <iframe>: which powerful browser features the framed document may use. Most of these features (camera, microphone, geolocation, fullscreen, payment) are on by default for your own origin and off for cross-origin frames. allow delegates them to the frame.
Granting a feature does not skip the user's consent. A frame allowed to use the camera still triggers the browser's permission prompt; without allow, the request fails without a prompt.
Both frames are sandboxed, so like a third-party embed they are not same-origin with the page. Only the first is granted fullscreen: its document.fullscreenEnabled is true, and its button works.
Values
A semicolon-separated list of directives. Each directive is a feature name followed by an optional allowlist of origins. With no attribute, a cross-origin frame gets none of the features whose default is 'self'.
Syntax
Meaning
allow="camera"
Allow for the origin of the frame's src (the default, written 'src').
allow="camera https://meet.example.com"
Allow only if the frame's document is from that origin, even after it navigates.
allow="camera 'self'"
Allow only for your page's origin.
allow="camera *"
Allow for any origin the frame navigates to.
allow="camera 'none'"
Deny, even for a same-origin frame.
allow="camera; microphone"
Several directives, separated by semicolons.
Frequently used features: camera, microphone, display-capture, fullscreen, geolocation, payment, autoplay, picture-in-picture, encrypted-media, clipboard-write, web-share, screen-wake-lock, accelerometer, gyroscope. Unknown names are ignored with a console warning.
Examples
Fullscreen for a video
allowfullscreen is the one fullscreen syntax every engine supports. Chrome and Firefox also read allow="fullscreen", which takes precedence when both are present; Safari does not, so keep allowfullscreen.
sandbox restricts what the frame's document can do (scripts, forms, navigation); allow grants powerful APIs. They are independent and work well together.
allow-scripts allow-same-origin is safe here only because the frame is on another origin. For same-origin or srcdoc content it lets the frame escape; see sandbox.
In Vanilla Breeze
<youtube-player> builds its iframe with allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share", allowfullscreen, referrerpolicy="strict-origin-when-cross-origin" and loading="lazy" (src/web-components/youtube-player/logic.js). It loads only after the user clicks the thumbnail.
<social-embed> grants nothing by default; the X provider adds allow="fullscreen". Frames are built by createEmbedFrame() in src/web-components/social-embed/shared.js, which also sets the sandbox and referrerpolicy="strict-origin".
The <browser-window> used for these docs passes allow, allowfullscreen and referrerpolicy through to its iframe.
For sizing, use iframe[data-ratio] (src/native-elements/iframe/styles.css).
Accessibility
Fullscreen and picture-in-picture help people who need larger video. Do not withhold them from video embeds.
Explain on your page why an embed asks for the camera, microphone or location before the user meets the browser prompt.
Give every iframe a title.
Security
Grant the least you can. Provider embed codes often list every feature they might use. Remove the ones your embed does not need.
Prefer the default 'src' allowlist or a named origin over *. With *, the permission follows the frame wherever it navigates.
A frame cannot get more than your page has. If your page's own policy denies a feature, no allow can re-enable it for a frame.
Browser support
The attribute: Chrome 60, Firefox 74, Safari 11.1. As of November 2026 (MDN browser-compat-data), Safari honours only camera, microphone, display-capture and screen-wake-lock in allow; it does not support fullscreen, autoplay, geolocation, payment or picture-in-picture there. The Permissions-Policy HTTP header that sets your page's own policy is Chromium-only.
Gotchas
allow="fullscreen" alone breaks fullscreen in Safari. Add allowfullscreen.
allowpaymentrequest is obsolete. It was removed from Firefox (83) and never shipped in Safari. Use allow="payment".
Changes apply on the next navigation. Editing allow on a loaded frame does not change the current document's policy.
Same-origin frames already have most features.allow matters mainly for cross-origin and sandboxed (opaque-origin) frames, and for denying with 'none'.
Related
sandbox — restrict what the frame's document can do.