-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Expose COOP and COEP state to JavaScript #4872
Comments
My only comment is we should be careful about adding user-facing APIs using new terms that don't appear elsewhere for web developers. I think "embedder" is probably already in some public APIs, but "agent cluster" is definitely not. |
That's fair, I'd also be fine with |
Closes #4872. (I'm not convinced we need to add crossOriginOpener and crossOriginEmbedder for now.)
I've added |
|
I've learned a bit more about this problem space and I think it might be worth some last-minute bikeshedding on the name. To be clear, I am OK with In particular we have two types of isolation coming down the pipe:
These are both valuable and complementary. I want to check though that the names are good. In particular, we appear to be headed toward a world where we bill these to developers as "cross-origin isolation" and "origin isolation". E.g. one could imagine I'm definitely open to renaming the origin isolation proposal if that would be helpful. Perhaps it could be something more like "memory sharing isolation" or "same origin-only memory sharing"? (Those kind of assume that "non-shared memory" implies "cannot synchronously script each other", which may not be obvious...) |
I realized that origin isolation is only relevant for window agents (see WICG/origin-agent-cluster#4), perhaps that can lead to a clearer name? It's also not immediately clear we'd need to expose the API in shared/service workers as they are scoped by origin (well, they're really scoped by identity, which is arguably even better) by definition. COEP on the other hand does apply everywhere, and requires COOP in addition for window agents. (Aside: in Firefox we'll likely roll out COOP+COEP support before COEP in shared/service workers.) |
See #5122 for a new idea around COOP+COEP and origin isolation. I think keeping |
Folding this into #4732. |
As @kripken points out in https://twitter.com/kripken/status/1167225879488954369 using
postMessage()
for feature detection (see also #4732) is less than ideal as in the success case it'll generate a message event.(You could create an
<iframe>
, but that seems ungainly. You could also create aMessageChannel
, except that doesn't work well across browsers and is not likely to be solved soon.)Idea:
window.crossOriginOpener
, returns the empty string, "same-origin
", "same-site
", "same-origin unsafe-allow-outgoing
", or "same-site unsafe-allow-outgoing
".self.crossOriginEmbedder
, returns the empty string or "require-corp
".self.isolatedAgentCluster
, returns true if the first returns "same-origin
" and the second "require-corp
"; otherwise false.(
window.
only exposed onWindow
,self.
onWindowOrWorkerGlobalScope
or potentially something that includes worklets as audio worklets will need this too.)cc @mikewest @arturjanc @rniwa @othermaciej @domenic
The text was updated successfully, but these errors were encountered: