Permissions Policy investigation to check that browsers apply the same rules

Open
#1,448 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
css, html, javascript

Research direction

Review the existing WPT tests in the permissions-policy, geolocation, and fullscreen directories. Understand the WebDriver BiDi tools for setting permissions and simulating devices. The goal is to extend the test suite to cover response headers, iframe allow lists, nested frames, and navigation, starting with fullscreen and geolocation. Check that the test setup works across browsers and that allowed actions succeed.

Written by the indexing model from the issue text.

Description

investigation-effort-proposal
Description

I propose an Interop 2027 investigation of how browsers apply Permissions Policy rules, covering response headers, lists of sites allowed to use a feature in an iframe, rules passed from parent pages to embedded pages, nested frames, and navigation.

The goal is a test suite that would follow the Permissions Policy specification.

The first scope should use fullscreen and geolocation, with checks that the required permissions and test setup work. Camera and microphone could follow when tests can reliably grant permissions, simulate devices, and demonstrate that access succeeds when allowed.

Specification and existing tests

Rationale

Permissions Policy determines whether embedded content can use capabilities such as geolocation or fullscreen.

The previous focus-area proposal #1082 and investigation proposal #1132 were not selected for Interop 2026. Reviewer feedback on #1082 found that the list included tests mainly about other features, some without an agreed standard or broad browser support. This proposal adds specific tests to review, checks that allowed actions succeed, and clear goals to address that feedback.

MDN compatibility data records a gap in support for the modern response header in Firefox and Safari. Support for headers, iframe rules, the affected APIs, and inspection of policy settings should nevertheless be assessed separately. A single label for the whole mechanism cannot describe the work accurately.

Existing tests show why this separation matters. permissions-policy-header-policy-allowed-for-self.https.sub.html directly calls document.permissionsPolicy.getAllowlistForFeature(). Its failure cannot by itself identify a failure to apply a policy rule. The geolocation header-denial test instead grants user permission and then checks that the policy still blocks the API. Its self-origin counterpart includes successful geolocation and uses the WebDriver BiDi test tools to set permissions and supply a simulated location. The review must check that these tools work in every target browser.

Navigation provides another specific case to review. Specification issue #578 discusses a mismatch after a cross-origin iframe navigates to a same-origin document. The editor's explanation distinguishes the origin of the loaded page, which controls actual access, from the origin assumed by the API that inspects iframe policy. The existing fullscreen navigation test contains an expectation that needs review against that explanation. Its current assertion should not silently become a scoring requirement.

The policy-inspection API also has its own open discussion #401. The newer #591 is closed as a duplicate of that discussion. A suggestion there to rely on the Permissions API is not an agreed removal of the existing interface.

Reasons for including the feature
  • Measured use on websites: The 2025 HTTP Archive Web Almanac reports the Permissions-Policy header on 3.7% of websites in its mobile crawl. It also reports that 29.2% of the 33.3 million iframe elements observed on mobile had an allow attribute. So websites using a header and iframe elements using an attribute and neither proves that all browsers enforce those rules correctly.
  • A real application workaround: In the DrChrono developer discussion about microphone access, the platform explains that its policy does not allow microphone or camera access inside the embedded app. It recommends opening the app in another tab or window. This shows how policy choices affect real application flows. It is an example of a hosting restriction, not evidence of a browser bug or a request to bypass that restriction.
  • Browser implementation work: Firefox bug 1531012 is the tracking issue for Permissions Policy. The navigation report in specification issue #578 adds a specific case where browsers were reported to behave differently. The investigation can connect clear tests to such reports instead of treating every failed policy-related test as the same problem.
  • Direct reviewer feedback: The earlier Interop review asks for a smaller test list that matches the intended proposal. This investigation answers that request. No feature-specific survey percentage is claimed; the website measurements and concrete reports are the evidence offered here.

Investigation Roadmap

This investigation should give developers and implementers a clearer account of which policy operations differ and why while creating a practical foundation for later implementation work.

Dominant language
JavaScript
Stars
591
Forks
39
Avg merge
3h 8m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from web-platform-tests/interop

All issues in web-platform-tests/interop

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.