Extensions: Inherit SecurityOrigin in chrome-extension workers
This CL changes the WorkerGlobalScope's SecurityOrigin for workers constructed in chrome-extension. Previously, workers didn't inherit the origin from their parents but create security origin from their url. SecurityOrigin::Create(creation_params->script_url); Usually, the result of this is the same with inheriting the parent origin since workers are same-origin only. However, in chrome-extension, it is allowed to construct a cross-origin worker if the script url has the permission. In this case, we should inherit the origin with 'chrome-extention://example/' so that the |request_initiator| matches to what the browser can see. This CL also adds the test for subresource fetch from dedicated workers and shared workers constructed in chrome-extension. This test covers the case that worker's script url is cross-origin to chrome-extension but included in permitted urls by chrome-extension. The worker should allow same-origin and cross-origin fetch unless the script url is not permitted by chrome-extension. Bug: 1059218 Change-Id: I498399275d3b4c2c3085e26a8e37145aa74f1d21 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2091327Reviewed-by:Mike West <mkwst@chromium.org> Reviewed-by:
Devlin <rdevlin.cronin@chromium.org> Reviewed-by:
Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:
Łukasz Anforowicz <lukasza@chromium.org> Commit-Queue: Eriko Kurimoto <elkurin@google.com> Cr-Commit-Position: refs/heads/master@{#751616}
Showing
Please register or sign in to comment