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

COEP reporting for workers expects an environment settings object but gets Document or WorkerGlobalScope objects #6518

Closed
zcorpan opened this issue Mar 22, 2021 · 1 comment · Fixed by #6525
Labels
topic: cross-origin-embedder-policy Issues and ideas around the new "require CORP for subresource requests and frames and etc" proposal. topic: workers

Comments

@zcorpan
Copy link
Member

zcorpan commented Mar 22, 2021

See https://html.spec.whatwg.org/#worker-processing-model

step 2:

Let owner be the relevant owner to add given outside settings.

Given an environment settings object o when creating or obtaining a worker, the relevant owner to add depends on the type of global object specified by o. If o specifies a global object that is a WorkerGlobalScope object (i.e., if we are creating a nested dedicated worker), then the relevant owner is that global object. Otherwise, o specifies a global object that is a Window object, and the relevant owner is the responsible document specified by o.

So owner is either a WorkerGlobalScope object or a Document object.

step 14.8:

If the result of checking a global object's embedder policy with worker global scope, owner, and response is false, then set response to a network error.

https://html.spec.whatwg.org/#check-a-global-object's-embedder-policy says

To check a global object's embedder policy given a WorkerGlobalScope workerGlobalScope, an environment settings object owner, and a response response:

owner is expected to be an environment settings object, but it will be either a Document object or a WorkerGlobalScope object.

Should "run a worker" pass outside settings instead of owner?

@zcorpan zcorpan added topic: workers topic: cross-origin-embedder-policy Issues and ideas around the new "require CORP for subresource requests and frames and etc" proposal. labels Mar 22, 2021
@yutakahirano
Copy link
Member

Thank you for catching this, SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: cross-origin-embedder-policy Issues and ideas around the new "require CORP for subresource requests and frames and etc" proposal. topic: workers
Development

Successfully merging a pull request may close this issue.

2 participants