Contact emails
Explainer
Link to explainer
Spec
https://wicg.github.io/webappsec-feature-policy/#introspection
(moving soon, new location likely https://w3c.github.io/webappsec-feature-policy/#introspection)
Tag review request: https://github.com/w3ctag/design-reviews/issues/292
Summary
This change adds an interface to inspect the current feature policy in a document, as well as to see what policy would be applied to an iframe in that document.
Developers can use this to ask questions like:
What features does this browser support?
What features are currently enabled?
What origins will automatically inherit access to these features?
If I create an iframe, what features will it have enabled?
Link to “Intent to Implement” blink-dev discussion
Intent to experiment thread at https://groups.google.com/a/chromium.org/d/msg/blink-dev/pQZopKWaQIk/Z-XD1hvwBQAJ
Link to Origin Trial feedback summary
The feature was available in an origin trial between Chrome 69 and 71. There were 13 tokens issued to 9 origins.
Most of the feedback was out of band, on GitHub or through personal communication.
We had feedback that the attribute name should probably be the more specific 'featurePolicy', rather than the original generic 'policy', and we had a few requests for the ability to get a list of features supported by the user agent. Both suggestions have been implemented in the latest spec.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Demo link
https://feature-policy-demos.appspot.com
Debuggability
The feature provides a JS interface which can be queried from the DevTools console. Additionally, there is a chrome DevTools extension available at https://chrome.google.com/webstore/detail/feature-policy-tester-dev/pchamnkhkeokbpahnocjaeednpbpacop which makes use of the API to provide DevTools control over a document's feature policy.
Risks
Interoperability and Compatibility
Hopefully fairly low risk, Mozilla has started implementing the API already, and I expect that other browsers will follow suit once they implement the rest of Feature Policy.
Edge: Public support for Feature Policy, no signals for this specific API
Firefox: In development
Safari: No signals
Ergonomics
This will likely be used with the features controlled by feature policy -- it may make some methods of those features redundant: document.fullscreenAllowed, for instance, should be identical to document.featurePolicy.allowsFeature('fullscreen')
Could the default usage of this API make it hard for Chrome to maintain good performance (i.e. synchronous return, must run on a certain thread, guaranteed return timing)? - No.
Activation
Will it be challenging for developers to take advantage of this feature immediately, as-is?
Would this feature benefit from having polyfills, significant documentation and outreach, and/or libraries built on top of it to make it easier to use?
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
Yes. (The document.featurePolicy.features() API is testable, but tests are still being completed - follow along at https://bugs.chromium.org/p/chromium/issues/detail?id=917070)
Entry on the feature dashboard
https://www.chromestatus.com/feature/5190687460950016
Contact emails
Explainer
Link to explainer
Spec
https://wicg.github.io/webappsec-feature-policy/#introspection
(moving soon, new location likely https://w3c.github.io/webappsec-feature-policy/#introspection)
Tag review request: https://github.com/w3ctag/design-reviews/issues/292
Summary
This change adds an interface to inspect the current feature policy in a document, as well as to see what policy would be applied to an iframe in that document.
Developers can use this to ask questions like:
What features does this browser support?
What features are currently enabled?
What origins will automatically inherit access to these features?
If I create an iframe, what features will it have enabled?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAK_TSXLC3kUVrUivBOeA1cnByfq3rdr561_Z-nWYWco8u%3DDv1g%40mail.gmail.com.
Friendly post-holidays ping! :)On Mon, Dec 24, 2018 at 7:53 AM Yoav Weiss <yo...@yoav.ws> wrote:On Thu, Dec 20, 2018 at 10:50 PM Ian Clelland <icle...@chromium.org> wrote:Contact emails
Explainer
Link to explainer
Spec
https://wicg.github.io/webappsec-feature-policy/#introspection
(moving soon, new location likely https://w3c.github.io/webappsec-feature-policy/#introspection)
The link was broken, so I took the liberty to put my WICG chair hat on and create a redirection repo :)
This particular section is described as "not stable". Is that still the case? How confident are we that the API shape is final?
Tag review request: https://github.com/w3ctag/design-reviews/issues/292
Summary
This change adds an interface to inspect the current feature policy in a document, as well as to see what policy would be applied to an iframe in that document.
Developers can use this to ask questions like:
What features does this browser support?
What features are currently enabled?
What origins will automatically inherit access to these features?
If I create an iframe, what features will it have enabled?
I find the spec examples lacking feature detection advice.IIUC, developers can find if this is supported or not by seeing if `featurePolicy()` is there, but what are they supposed to do if it's not?I'm guessing they should just assume that those capabilities are enabled, but some official developer advice would be good on that front.
In general, without document.featurePolicy, developers will have to go back to the ad hoc heuristics around each feature. If you can infer that feature policy itself is supported, with either HTMLIframeElement.allow or UA sniffing, then you can make correct inferences about how availability of a particular feature will be granted to subframes. Determining that feature's availability in your own frame, however, will require different methods for different features. Fullscreen, for instance, has window.fullscreenEnabled; permissions-based features have the Permissions API (although the information obtained from that is a bit different from what you get out of featurePolicy); and availability of features like 'sync-xhr' can't really be detected, only caught on failure.
Link to “Intent to Implement” blink-dev discussion
Intent to experiment thread at https://groups.google.com/a/chromium.org/d/msg/blink-dev/pQZopKWaQIk/Z-XD1hvwBQAJ
Link to Origin Trial feedback summary
The feature was available in an origin trial between Chrome 69 and 71. There were 13 tokens issued to 9 origins.
Most of the feedback was out of band, on GitHub or through personal communication.
We had feedback that the attribute name should probably be the more specific 'featurePolicy', rather than the original generic 'policy', and we had a few requests for the ability to get a list of features supported by the user agent. Both suggestions have been implemented in the latest spec.
Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes.
Demo link
https://feature-policy-demos.appspot.com
Debuggability
The feature provides a JS interface which can be queried from the DevTools console. Additionally, there is a chrome DevTools extension available at https://chrome.google.com/webstore/detail/feature-policy-tester-dev/pchamnkhkeokbpahnocjaeednpbpacop which makes use of the API to provide DevTools control over a document's feature policy.
Risks
Interoperability and Compatibility
Hopefully fairly low risk, Mozilla has started implementing the API already, and I expect that other browsers will follow suit once they implement the rest of Feature Policy.
Edge: Public support for Feature Policy, no signals for this specific API
Firefox: In development
Safari: No signals
Ergonomics
This will likely be used with the features controlled by feature policy -- it may make some methods of those features redundant: document.fullscreenAllowed, for instance, should be identical to document.featurePolicy.allowsFeature('fullscreen')
Could the default usage of this API make it hard for Chrome to maintain good performance (i.e. synchronous return, must run on a certain thread, guaranteed return timing)? - No.
Activation
Will it be challenging for developers to take advantage of this feature immediately, as-is?
Would this feature benefit from having polyfills, significant documentation and outreach, and/or libraries built on top of it to make it easier to use?
Is this feature fully tested by web-platform-tests? Link to test suite results from wpt.fyi.
Yes. (The document.featurePolicy.features() API is testable, but tests are still being completed - follow along at https://bugs.chromium.org/p/chromium/issues/detail?id=917070)
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CACj%3DBEiaBFF-H2x7rFwy_w3SysC2C5CN6j3zrbsnuO%2BKGFwXuw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/op.zwhkx1perbppqq%40cicero2.linkoping.osa.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAOMQ%2Bw8BzHJh_-ZBx78MfM2kA0iOYqx1LrG0bbzTSUp7EbgeWQ%40mail.gmail.com.