Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 623682 Launch Feature Policy
Starred by 22 users Project Member Reported by iclell...@chromium.org, Jun 27 2016 Back to list
Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux, Android, Windows, Chrome, Mac
Pri: 3
Type: Launch-OWP
Launch-Accessibility: NotReviewed
Launch-Legal: NotReviewed
Launch-M-Approved: ----
Launch-M-Target: 59-Dev, 59-Beta, 59-Stable-Exp, 59-Stable
Launch-Privacy: ----
Launch-Security: ----
Launch-Status: Review-Requested
Launch-Test: ----
Launch-UI: ----


Sign in to add a comment
Change description:
Implement a framework to allow site owners to selectively enable and disable web platform features on their pages. By setting a response HTTP header, site owners can disable parts of the web platform on their pages, including in embedded third party content.

Changes to API surface:
- New HTTP header: Feature-Policy
- Optionally disabled features: (Completely removed, or permission denied, as necessary. This list is subject to change as the spec settles)
   - document.cookie
   - document.domain
   - document.write/writeln
   - geolocation
   - MIDI
   - notifications
   - push
   - synchronous scripts
   - synchronous XHR
   - WebRTC


Links:
Draft Spec: https://wicg.github.io/feature-policy/
Public standards discussion: All discussions are currently at https://github.com/igrigorik/feature-policy/issues

Support in other browsers:
Internet Explorer: No
Firefox: No
Safari: No
No current support, but other browser vendors have been positive towards the idea.
 
> Implement a framework to allow site owners to selectively enable and disable web platform features 

I do not see any wording in the referenced spec that would also allow opting in for features - the spec seems to only referencing disabling features.


The header would probably have to specify whether it's a whitelist or blacklist. 
Comment 3 Deleted
Blockedon: 634921
Blocking: 637874
Blockedon: 638238
Blockedon: 638240
Blockedon: 661271
Blockedon: 661273
Blockedon: 661277
Blockedon: 661280
Blockedon: 661282
Project Member Comment 13 by bugdroid1@chromium.org, Nov 3 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d15b7fc471b33e2d52a45876cb8323a4fb0e780

commit 7d15b7fc471b33e2d52a45876cb8323a4fb0e780
Author: iclelland <iclelland@chromium.org>
Date: Thu Nov 03 16:58:10 2016

[FeaturePolicy] Initial implementation of Feature Policy

This CL adds to each frame (local or remote) a FeaturePolicy object, which can be used to control the exposure and behaviour of web platform features. A frame's policy is computed from the policy declared in the "Feature-Policy" HTTP header, it's parent frame's policy, and the default policy for each feature.

See https://wicg.github.io/feature-policy/ for the specification in development.

Three features from the specification are implemented with this CL: cookie, domain, and docwrite.

(This behaviour is all conditional on the runtime flag for Feature Policy)

Future CLs are going to implement:
 - <iframe> attribute support
 - Layout tests
 - Parser fuzzing
 - Control over additional features

BUG=623682

Review-Url: https://codereview.chromium.org/2254533002
Cr-Commit-Position: refs/heads/master@{#429623}

[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/core/dom/Document.idl
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/core/frame/Frame.cpp
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/core/frame/Frame.h
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/core/loader/FrameLoader.cpp
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/BUILD.gn
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
[add] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
[add] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h
[add] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/feature_policy/FeaturePolicyTest.cpp
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/network/HTTPNames.in
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/network/HTTPParsers.cpp
[modify] https://crrev.com/7d15b7fc471b33e2d52a45876cb8323a4fb0e780/third_party/WebKit/Source/platform/network/HTTPParsers.h

Blockedon: 663731
Project Member Comment 15 by bugdroid1@chromium.org, Nov 10 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/223219ddca24df5f57dfb8c7e286690ad8800d16

commit 223219ddca24df5f57dfb8c7e286690ad8800d16
Author: iclelland <iclelland@chromium.org>
Date: Thu Nov 10 19:15:29 2016

Add CORE_EXPORT to blink::isFeatureEnabledInFrame for Feature Policy

BUG=623682

Review-Url: https://codereview.chromium.org/2491353002
Cr-Commit-Position: refs/heads/master@{#431312}

[modify] https://crrev.com/223219ddca24df5f57dfb8c7e286690ad8800d16/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.h

Cc: lunalu@chromium.org
Blockedon: 664374
Blockedon: 666761
Blockedon: 666762
Blockedon: 666765
Blockedon: 666767
Labels: Feature-Policy
Project Member Comment 24 by bugdroid1@chromium.org, Nov 25 2016
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/11eca67f18be0dfbfcb1703a21abb454e5f85b05

commit 11eca67f18be0dfbfcb1703a21abb454e5f85b05
Author: lunalu <lunalu@chromium.org>
Date: Fri Nov 25 02:09:41 2016

Implementation for feature policy - vibrate.
Disable Navigator.vibrate() unless enabled through feature policy.

Added tests with runtime flag is on

Also modified IsFeatureEnabledInFrame for the case EnableForSelf, should only be enabled when with same origin.

BUG=623682

Review-Url: https://codereview.chromium.org/2492623002
Cr-Commit-Position: refs/heads/master@{#434423}

[modify] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/VirtualTestSuites
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-vibrate-disabled.html
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/resources/feature-policy-vibrate-enabled.html
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled-expected.txt
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-disabled.php
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall-expected.txt
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforall.php
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself-expected.txt
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/http/tests/feature-policy/vibrate-enabledforself.php
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/README.txt
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-disabled-expected.txt
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforall-expected.txt
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate-enabledforself-expected.txt
[add] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/LayoutTests/virtual/feature-policy/http/tests/feature-policy/vibrate_in_cross_origin_iframe_blocked-expected.txt
[modify] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/Source/bindings/core/v8/ConditionalFeatures.cpp
[modify] https://crrev.com/11eca67f18be0dfbfcb1703a21abb454e5f85b05/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp

Components: Blink>FeaturePolicy
Labels: -M-54
Blockedon: 679385
Blockedon: 696819
Blockedon: -661271
Blockedon: -664374
Blockedon: -666767
Blockedon: 704904
Blockedon: -661280
Blockedon: -666765
Labels: Launch-M-Target-59-Dev Launch-M-Target-59-Beta Launch-M-Target-59-Stable-Exp Launch-M-Target-59-Stable Launch-Status-Review-Requested
This is essentially feature complete -- there is still some ongoing engineering, but I think this is the time I'm supposed to request X-Functional review.
Blink intent-to-ship: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/uKO1CwiY3ts

The spec has been moved since this bug was filed, and now lives at https://wicg.github.io/feature-policy/

Additionally, the features which are initially going to be controlled by policy has been cut back. For M57, we are looking to support three features:
  - Fullscreen
  - PaymentRequest
  - Vibrate

https://github.com/w3c/web-platform-tests/pull/5055

Planning to write more web platform tests (e.g., when both allow="fullscreen" and allowfullscreen are present).  
Description: Show this description
Blockedon: 705658
Blocking: 711443
Blockedon: 713364
Blockedon: 716478
Blockedon: 718155
Blockedon: 718160
Project Member Comment 45 by bugdroid1@chromium.org, May 12
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e

commit 8f64c57f0ae067e658a1d903fbbf5cbdb44e135e
Author: lunalu <lunalu@chromium.org>
Date: Fri May 12 16:38:25 2017

Enable Feature Policy without experimental features or fullscreen

Intent to ship: https://groups.google.com/a/chromium.org/forum/?hl=en#!searchin/blink-dev/intent$20to$20ship$20feature$20policy/blink-dev/uKO1CwiY3ts/62vV7xmaCQAJ

BUG=623682

patch from issue 2864723002 at patchset 20001 (http://crrev.com/2864723002#ps20001)

Review-Url: https://codereview.chromium.org/2873433002
Cr-Commit-Position: refs/heads/master@{#471329}

[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/content/browser/site_per_process_browsertest.cc
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/content/public/common/content_features.cc
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/LayoutTests/TestExpectations
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/external/wpt/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/external/wpt/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/external/wpt/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/external/wpt/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-allowed-by-container-policy-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-allowed-by-container-policy-relocate-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-disabled-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-enabledforall-expected.txt
[delete] https://crrev.com/f14c1e33e651019be3557f43121aff4a445c00b2/third_party/WebKit/LayoutTests/http/tests/feature-policy/payment-enabledforself-expected.txt
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/LayoutTests/platform/mac/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/LayoutTests/platform/win/virtual/stable/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/LayoutTests/virtual/service-worker-navigation-preload-disabled/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/LayoutTests/virtual/stable/webexposed/element-instance-property-listing-expected.txt
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/LayoutTests/webexposed/element-instance-property-listing-expected.txt
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/Source/core/dom/Fullscreen.cpp
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/Source/core/html/HTMLIFrameElementAllowTest.cpp
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/Source/modules/payments/PaymentRequest.cpp
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/Source/modules/vibration/NavigatorVibration.cpp
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.json5
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.cpp
[modify] https://crrev.com/8f64c57f0ae067e658a1d903fbbf5cbdb44e135e/third_party/WebKit/Source/platform/feature_policy/FeaturePolicy.h

Blocking: 728879
Blocking: 518042
Cc: -lunalu@chromium.org loonybear@chromium.org
Sign in to add a comment