Skip to Content
Platform.Ontology

Permissions Policy and iframe allow

HTTP header and iframe allow attribute that decide which features a page or frame may use.

Works without askingDevice detailsPolicyWeb browsersWhile you use it

In one line

Can turn features off for itself and its embedded frames

HTTP header and iframe allow attribute that decide which features a page or frame may use.

Lets a site disable features for itself and its iframes. MDN lists 51 directives; each can be self, a list of origins, or none. A feature blocked here never reaches the user prompt.

What it can and can't do

What the user does: Nothing. The site sets rules in its headers or in an iframe

It can

  • Block features like camera, location, or microphone for itself
  • Allow a feature in an iframe only if both sides agree
  • Stop embedded ads or widgets from using sensors
  • Set 51 or so rules, each for self, listed sites, or none

It cannot

  • Give itself more than you allow in the browser
  • Turn on a feature you blocked
  • Let an embedded frame use a feature the parent blocked
  • Skip your pop up for a feature

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported882021-01-19None
EdgeSupported882021-01-21None
FirefoxSupported742020-03-10None
SafariSupported11.12018-04-12None
Safari on iPhoneSupported11.32018-03-29None
Chrome on AndroidSupported882021-01-19None
Samsung InternetSupported12.02020-06-19None

How a site asks for it

APIPermissions-Policy: geolocation=(self); <iframe allow="camera; microphone">; document.featurePolicy
How access is grantednone
What the user seesServer sent header plus iframe allow attribute; cross-origin frames get a feature only if both parent and frame allow it.
Needs a secure context (HTTPS)Yes
Needs a user gestureNo
How long it lastsPer document
How to take it backChange header or allow
Inside an iframeControls iframe delegation

Typical flow

  1. Server sets Permissions-Policy header
  2. Embedder sets allow on iframe
  3. Browser intersects the policy
  4. Feature granted to frame or blocked

Data you get

What comes back: Feature policy decisions
Shape: list
How often: per document load

FieldTypeUnitRangePrecision
directivesintegercount51 listed on MDNn/a

Technical limits

  • Camera, microphone, geolocation default to self
  • Directive names vary per browser
  • Cannot grant what the user denied

The story

What it is

A site rule that says which features the page and its embedded frames are allowed to use.

For you

You never see it. Its job is to protect you: a site can promise that an embedded ad or video cannot reach your camera or location. If a site forgets, an embed might not work.

For makers

Sites use it to lock off powerful features from third party frames, such as ads or widgets. It lowers the damage if an embed is hacked. Embedding services must also ask for the access they need through the allow attribute.

Where you see it

TypeExampleApps
videoA site embeds a video meeting in a frame and allows camera and microphone only for that frame.Zoom Web SDK
adsA publisher blocks geolocation and camera for all ad frames so ads cannot reach them.None named
gamesA game portal allows fullscreen and gamepad access only to the game frame.itch.io
paymentsA shop allows the payment request feature only for its payment provider frame.Stripe
securityA bank turns off camera, microphone and location for its own pages.None named
developerA team tests that a third party widget breaks cleanly when a feature is blocked.None named
enterpriseA company web portal blocks sensors for all embedded dashboards.None named

Risks

  • If misconfigured, embeds break
  • Only as safe as the site makes it

What the platform says

Good uses and abuse

Legitimate uses

  • Locking down embeds

Known abuse

  • None direct, but misconfiguration over-delegates

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility5 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2018-07, Chrome 60: Feature-Policy header ships
  • 2020-07, Chrome 88: Permissions-Policy replaces Feature-Policy
  • Permissions API. Can check whether you allowed or blocked a feature, without asking you

Sources

How well checked: Checked against real behavior.

On this page