A web page may be able to locate a device, access a camera or microphone, or enter fullscreen mode. The Permissions-Policy response header lets a site limit which origins can use supported browser features in a document and its embedded frames. A policy can block a feature or restrict access to selected origins, but it does not override the user's permission choices or operating system privacy settings.

Base the policy on the features each page actually uses. Copying another site's policy can break a map's location function or prevent a video call, while a broad allowance can leave an embedded widget with access it does not need. List the required features, decide which pages and frames need them, and check both allowed and blocked cases in the browsers the site supports.

Inventory the Features Your Pages Use

List the browser APIs used by the site's own code and any embedded widgets. A location tool may need geolocation on one page. A support widget may need microphone access in a cross-origin iframe. A marketing page may not need either. Record the origin of the main page and each embedded frame, the required feature, and the reason for allowing access. An origin is the combination of scheme, hostname, and port; changing any of those makes a frame cross-origin, even if both pages belong to the same organization.

Check the default allowlist for each feature; omitting a directive does not necessarily disable that feature. Explicitly disable features the application does not need, and allow required features only for the pages and frames that use them. These restrictions work only where the browser supports and enforces the relevant directive.

Permissions Policy is separate from user consent. If a page is allowed to ask for geolocation, the browser can still prompt the user, and the user can refuse. If the policy blocks geolocation, the browser can reject the location request without asking the user. The operating system can impose another independent block. A policy that permits a feature therefore does not guarantee that the feature will work.

Separate Top-Level and Embedded Frames

A Permissions-Policy header on the main page restricts that document and the frames nested within it. Each iframe can also have an allow attribute that narrows access for that frame. When the parent header explicitly limits a feature, the frame must meet both the header restriction and its own allow setting. A child frame cannot restore a feature blocked by an ancestor.

The parent must also retain access to a feature before delegating it to a child. If a header allowlist excludes the parent's own origin, listing a partner origin alone will not make the feature available to that partner frame. Include self when the parent needs to pass access to a listed third party.

For a cross-origin widget, include its origin in any explicit header allowlist for the required feature and configure the iframe's allow attribute. When the header has no restriction for that feature, the feature's default and the iframe settings still matter. If the frame navigates to another origin, recheck that destination; the initial allowance may not cover the new page. Do not replace a specific origin with a wildcard merely to make a failing integration work.

Write Narrow Allowlists

Write each header directive as a feature name, an equals sign, and its allowance. An empty pair of parentheses blocks the feature: Permissions-Policy: geolocation=() disables geolocation in the document and its nested frames. Use (self) to allow the document's own origin, or add space-separated origins in double quotes inside the parentheses. Separate different feature directives with commas.

For example, a page that uses an embedded location map but needs no camera or microphone could send this header. The map origin is illustrative and must be replaced with the origin actually used by the integration.

Permissions-Policy: geolocation=(self "https://maps.example.net"), camera=(), microphone=()

The page and permitted frames may request geolocation, while camera and microphone access are blocked by policy. The corresponding map iframe can explicitly allow geolocation for that origin:

<iframe src="https://maps.example.net/map" title="Location map"
  allow="geolocation https://maps.example.net"></iframe>

Use exact origins where practical, including a nondefault port if the frame uses one. The value * allows every origin, so use that value only when the feature must be available to every origin. Introduce related restrictions together and check affected pages before adding more, so a broken function can be traced to the relevant change.

Inside an iframe's allow value, each feature name is followed directly by its origins, without an equals sign or parentheses. Do not quote each origin separately; use semicolons between features. For example, allow="camera https://call.example.net; microphone https://call.example.net" lists two features for one hypothetical call provider. Each feature must also be permitted by the parent policy.

Configure the response header in the application, web server, or content delivery network (CDN) that serves the page. If more than one layer sets headers, inspect the final response received by the browser. Editing the origin server configuration alone does not prove that a CDN has delivered the new value.

Account for Browser Support

Support differs between browsers, versions, and individual directives. A browser may ignore an unrecognized directive, and support for the header does not mean every feature restriction is implemented. Check the specific features in the browsers the site needs to support. A successful block in one browser does not establish the result in another.

For each tested browser, record its version and inspect the response header, frame attributes, console messages, and API result. Where available, violation reporting can help identify attempted use of a blocked feature, but it may not cover every client or every action. Do not use this header as the sole enforcement for a sensitive server-side capability; the server still needs authentication and authorization.

Verify Blocks and Permission Requests

On a page where policy should block a feature, attempt the relevant API call and check the failure reason. A failure alone does not prove the policy caused it; a missing device or a previously refused permission can also stop the call. Where policy should allow access, test the required function and distinguish a policy block from a permission prompt, a user denial, or an operating system restriction.

Repeat the test for the top-level page, same-origin frame, approved cross-origin frame, and unapproved frame where they apply. Check an iframe after navigation if the integration can move to a new origin. Recheck the response header received by the browser after deployments and CDN changes. Keep a record of which feature each frame needs, and remove an allowance when the corresponding widget or function is retired.