Skip to content

Rename PermissionsPolicy interface back to FeaturePolicy - #582

Open
marcoscaceres wants to merge 2 commits into
mainfrom
featurePolicy_api
Open

marcoscaceres wants to merge 2 commits into
mainfrom
featurePolicy_api

Conversation

@marcoscaceres

@marcoscaceres marcoscaceres commented Mar 12, 2026 •

Copy link
Copy Markdown
Member

Chrome shows that ~37% of sites tested are using document.featurePolicy:
https://chromestatus.com/metrics/feature/timeline/popularity/2511

We should consider switching this back.

Related web platform tests:
web-platform-tests/wpt#58463


Preview | Diff

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Permissions Policy specโ€™s script introspection API surface to use the legacy FeaturePolicy naming (matching current web-compat usage like document.featurePolicy) instead of PermissionsPolicy.

Changes:

  • Rename the script-facing policy object from PermissionsPolicy to FeaturePolicy in prose and examples.
  • Update WebIDL to expose Document.featurePolicy / HTMLIFrameElement.featurePolicy returning FeaturePolicy.

๐Ÿ’ก Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread index.bs Resolved
@annevk

annevk commented Mar 13, 2026

Copy link
Copy Markdown
Member

Since this API does not have agreement and only one implementation I think it would be better to remove it.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@marcoscaceres

Copy link
Copy Markdown
Member Author

Might be ok to remove it, but we would need to transplant it to the Web Compat spec.

@annevk

annevk commented Oct 14, 2026

Copy link
Copy Markdown
Member

Why? There's only one implementation and nobody else wants to implement it.

@marcoscaceres

Copy link
Copy Markdown
Member Author

Ok, sure (and I agree), but we have the "37% of sites tested are using" it Chrome situation... this is a transitional path. This at least matches Chrome and we can then hopefully get agreement at TPAC to remove it and document the path to using permissions.query() instead.

It's the least bad option right now, IMO.

As a compromise, should we maybe add a note/issue that says that this is a Feature at Risk?

@annevk

annevk commented Oct 14, 2026

Copy link
Copy Markdown
Member

I don't see why that is a reason to keep it in the specification? Also page loads doesn't translate to websites.

@marcoscaceres

Copy link
Copy Markdown
Member Author

I opened #600, which removes the API from the specification entirely, as @annevk suggested. We can discuss both options at TPAC.

@arichiv

arichiv commented Oct 26, 2026

Copy link
Copy Markdown
Member

@miketaylr suggested the usage might go away as privacy sandbox APIs are retired, agree we should discuss at TPAC

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants