allow (Permissions Policy)

The allow attribute sets the Permissions Policy for one iframe. It lists the browser features that the framed page may use, such as the camera, the microphone, or fullscreen.

HTML attribute

Also called Permissions-Policy, Feature Policy

Updated

On this page

How it works

Permissions Policy controls which browser features a page and its frames can use. A site sets it in two ways. The Permissions-Policy header sets it for the whole page. The allow attribute sets it for one iframe.

The browser joins the two policies and uses the stricter result. A frame gets a feature only when both the parent policy and the allow attribute list its origin. When a parent blocks a feature, the frame and its own frames cannot turn it back on.

Allowlist values

ValueMeaning in allow
(none)Same as 'src'. This is the default.
'src'Allowed if the framed page has the origin of src.
'self'Allowed for the origin of the parent page.
*Allowed for any origin.
'none'Blocked in the frame.
An originAllowed for that origin, for example https://widget.example.

Permissions Policy was called Feature Policy before. The header syntax changed with the name. The allow syntax stayed the same.

Example

HTML
<iframe
  src="https://widget.example/call"
  allow="camera; microphone; fullscreen"
  title="Video call"
></iframe>

A feature with no origin list uses 'src', the origin of the URL in src.

How to set it

List each feature the frame needs. Separate features with semicolons. Add origins after a feature to limit it.

<iframe
  src="https://widget.example/map"
  allow="geolocation 'src'; fullscreen 'none'"
  title="Store map"
></iframe>

The allow attribute cannot give more than the parent page has. If the Permissions-Policy header of the parent blocks a feature, the frame cannot use it.

Learn more

Sources

Know before you embed.

Free, no sign-up, nothing stored. Paste a URL and get a verdict, a live preview, and the fix.