Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add features for permissions policy and feature policy #2661

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions features/draft/feature-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
draft_date: 2025-02-16
name: Feature policy
description: The `Feature-Policy` response header sets whether a policy-controlled feature, such as an API, may be used in a document. Not to be confused with permissions policy.
spec: https://www.w3.org/TR/2019/WD-feature-policy-1-20190416/
caniuse: feature-policy
discouraged:
according_to:
- https://github.com/w3c/webappsec-permissions-policy/pull/379
alternatives:
- permissions-policy
compat_features:
- api.Document.featurePolicy
- api.FeaturePolicy
- api.FeaturePolicy.allowedFeatures
- api.FeaturePolicy.allowsFeature
- api.FeaturePolicy.features
- api.FeaturePolicy.getAllowlistForFeature
- api.HTMLIFrameElement.featurePolicy
17 changes: 17 additions & 0 deletions features/draft/feature-policy.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated from: feature-policy.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support:
chrome: "74"
chrome_android: "74"
edge: "79"
compat_features:
- api.Document.featurePolicy
- api.FeaturePolicy
- api.FeaturePolicy.allowedFeatures
- api.FeaturePolicy.allowsFeature
- api.FeaturePolicy.features
- api.FeaturePolicy.getAllowlistForFeature
- api.HTMLIFrameElement.featurePolicy
8 changes: 8 additions & 0 deletions features/draft/permissions-policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
draft_date: 2025-02-16
name: Permissions policy
description: The `Permissions-Policy` response header sets whether a policy-controlled feature, such as an API, may be used in a document.
spec: https://w3c.github.io/webappsec-permissions-policy/
caniuse: permissions-policy
compat_features:
- http.headers.Permissions-Policy
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah. I asked about this at the time and it seems like at some point somebody thought about it but nothing else came of it.

- http.headers.Permissions-Policy.wildcards
24 changes: 24 additions & 0 deletions features/draft/permissions-policy.yml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Generated from: permissions-policy.yml
# Do not edit this file by hand. Edit the source file instead!

status:
baseline: false
support:
chrome: "108"
chrome_android: "108"
edge: "108"
compat_features:
# baseline: false
# support:
# chrome: "88"
# chrome_android: "88"
# edge: "88"
- http.headers.Permissions-Policy

# ⬇️ Same status as overall feature ⬇️
# baseline: false
# support:
# chrome: "108"
# chrome_android: "108"
# edge: "108"
- http.headers.Permissions-Policy.wildcards
4 changes: 4 additions & 0 deletions scripts/specs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ const defaultAllowlist: allowlistItem[] = [
[
"https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/DocumentSubtitle/explainer.md",
"Allowed because this is where the application-title meta tag is spec'd at the moment. Remove when https://github.com/whatwg/html/issues/8909 is fixed."
],
[
"https://www.w3.org/TR/2019/WD-feature-policy-1-20190416/",
"Allowed because feature policy was replaced by permissions policy."
]
];

Expand Down