Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Original proposal
#7912
Description
This adds:
It reflects the environment's cross-origin-embedder-policy's value.
Security/Privacy
It is already possible to deduce the value returned by the API, by making a
fetch
toward a known cross-origin URL responding with the request's cookies and no CORS header.It is costly, but theoretically polyfillable. As such, it should be a security/privacy no-op.
Motivation
Depending on the Cross-Origin-Embedder-Policy value, not every iframe/subresources can be loaded inside the document. If this reflection API is provided, 3rd party scripts can take better decisions. They can implement fallbacks.
In particular, for trying Anonymous Iframe, Google DisplayAds, needs a way to know the COEP policy. The Ads's script could this way be able to decide in between inserting a normal or an anonymous iframe.
At least two implementers are interested (and none opposed):
Tests are written and can be reviewed and commented upon at:
Implementation bugs are filed:
(See WHATWG Working Mode: Changes for more details.)
/webappapis.html ( diff )