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

Explainer: Allow cross-origin script in addModule & align createWorklet #158

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

pythagoraskitty
Copy link
Collaborator

Currently, addModule only allows same-origin script. This was for convenience of the initial implementation, however, and is no longer necessary.

The worklet standard does not contain this restriction. In fact, we have received feedback from developers stating they would like to be able to host and run their worklet script on a separate origin---say a CDN---from the origin that owns and writes their shared storage data.

So we update the explainer to remove the same-origin restriction for addModule. We also note that, when the worklet script is cross-origin to the invoking context, the invoking context's origin is used as the partition origin for accessing shared storage.

Since createWorklet already allows cross-origin scripts, but currently uses the worklet script's origin as the data partition origin, updating addModule as described above without also making a change to createWorklet is liable to cause developer confusion in the long term.

We have therefore decided to align createWorklet's default data partition origin with addModule's. createWorklet will use the invoking context's origin by default. This is a breaking change, but current usage of createWorklet is low as it was just introduced in M125.

To preserve the ability to create a worklet whose script is cross-origin to the invoking context and then run operations on the worklet script origin's shared storage data, we introduce a new dataOrigin option for createWorklet. Passing dataOrigin with "script-origin" as its value will designate the worklet script origin as the partition origin for shared storage. For now, "script-origin" and "context-origin" will be the only allowed values for dataOrigin, when used. We’re considering adding support for separate data and script origins for createWorklet in the future.

A corresponding specification update will follow.

…orklet`

Currently, `addModule` only allows same-origin script. This was for convenience of the initial implementation, however, and is no longer necessary. 

The [worklet standard](https://html.spec.whatwg.org/multipage/worklets.html#dom-worklet-addmodule) does not contain this restriction. In fact, we have received [feedback](#127) from developers stating they would like to be able to host and run their worklet script on a separate origin---say a CDN---from the origin that owns and writes their shared storage data.

So we update the explainer to remove the same-origin restriction for `addModule`. We also note that, when the worklet script is cross-origin to the invoking context, the invoking context's origin is used as the partition origin for accessing shared storage.

Since `createWorklet` already allows cross-origin scripts, but currently uses the worklet script's origin as the data partition origin, updating `addModule` as described above without also making a change to `createWorklet` is liable to cause developer confusion in the long term.

We have therefore decided to align `createWorklet`'s default data partition origin with `addModule`'s. `createWorklet` will use the invoking context's origin by default. This is a breaking change, but current usage of `createWorklet` is low as it was just introduced in M125.

To preserve the ability to create a worklet whose script is cross-origin to the invoking context and then run operations on the worklet script origin's shared storage data, we introduce a new `dataOrigin` option for `createWorklet`. Passing `dataOrigin` with "script-origin" as its value will designate the worklet script origin as the partition origin for shared storage. For now, "script-origin" and "context-origin" will be the only allowed values for `dataOrigin`, when used. We’re considering adding support for separate data and script origins for `createWorklet` in the future.

A corresponding specification update will follow.
README.md Outdated
@@ -455,6 +459,41 @@ register('select-url', URLOperation);
register('report', ReportOperation);
```

### Using cross-origin worklets
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section is a bit confusing, as it's using cross-origin to mean different things. Use cases 1 and 2 are about cross-origin worklet script. Use case 3 is about a cross-origin data origin.

Can you instead make 2 sections, one titled "Loading cross-origin worklet scripts" and another, "Creating worklets with cross-origin data origins" or some such?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the section title to "Loading cross-origin worklet scripts" and slightly revised the content.

I think that it would make more sense to wait to add a separate "Creating worklets with cross-origin data origins" section until we decide to allow other values for the dataOrigin option (if we do).

Anyway, please take a look and see if the revised section looks good. If you would still like it in 2 sections, I can split it then. Thanks.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

| I think that it would make more sense to wait to add a separate "Creating worklets with cross-origin data origins" section until we decide to allow other values for the dataOrigin option (if we do).

Using script-origin is a cross-origin data origin from the calling context.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So does the revised section look good for the current proposal? Or are there any changes that we should make in this PR?

@dmdabbs
Copy link

dmdabbs commented Jun 13, 2024

If a publisher allows some partner to use SharedStorage via the policy-controlled feature, is there a way to restrict the partner's data access?

@dmdabbs
Copy link

dmdabbs commented Jun 13, 2024

Will the new dataOrigin capability be feature-detectable?

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@pythagoraskitty
Copy link
Collaborator Author

pythagoraskitty commented Jun 14, 2024

If a publisher allows some partner to use SharedStorage via the policy-controlled feature, is there a way to restrict the partner's data access?

The publisher/embedder can control which origins have access to Shared Storage via the Permissions Policy, yes. The origins allowed to use the policy-controlled feature "shared-storage" are those that will have permission to be used as data origins for the Shared Storage API.

Will the new dataOrigin capability be feature-detectable?

You will be able to detect it if you call createWorklet() with a valid same-origin worklet script as the source but an invalid value passed to "dataOrigin", e.g. something like

let dataOriginOptionDefined = false;
try {
  await sharedStorage.createWorklet("dummy-worklet.js", {dataOrigin: "invalid"});
} catch (e) {
  if (e.message.includes("dataOrigin")) {  // or some other check to help distinguish it from other possible errors
    dataOriginOptionDefined = true;
  }
}

We haven't implemented this yet, and the exact error message/type haven't been determined yet. So the above snippet is subject to change (and I didn't test it), but something along these lines should work.

pythagoraskitty added a commit that referenced this pull request Jun 18, 2024
We make the spec changes to accompany #158 . For a more detailed description, please see #158 .
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 21, 2024
We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
aarongable pushed a commit to chromium/chromium that referenced this pull request Jun 21, 2024
We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318000}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 21, 2024
We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318000}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jun 21, 2024
We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318000}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jun 27, 2024
…to createWorklet for use counter, a=testonly

Automatic update from web-platform-tests
Shared Storage: Add non-live dataOption to createWorklet for use counter

We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318000}

--

wpt-commits: 25b56c5748119452697daf6903523c3523fbb64a
wpt-pr: 46853
ErichDonGubler pushed a commit to ErichDonGubler/firefox that referenced this pull request Jun 27, 2024
…to createWorklet for use counter, a=testonly

Automatic update from web-platform-tests
Shared Storage: Add non-live dataOption to createWorklet for use counter

We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318000}

--

wpt-commits: 25b56c5748119452697daf6903523c3523fbb64a
wpt-pr: 46853
@pythagoraskitty pythagoraskitty merged commit 49cf9c8 into main Jun 27, 2024
1 check passed
@pythagoraskitty pythagoraskitty deleted the cammie-branch3 branch June 27, 2024 19:26
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Jun 28, 2024
…to createWorklet for use counter, a=testonly

Automatic update from web-platform-tests
Shared Storage: Add non-live dataOption to createWorklet for use counter

We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318000}

--

wpt-commits: 25b56c5748119452697daf6903523c3523fbb64a
wpt-pr: 46853
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Jul 1, 2024
…to createWorklet for use counter, a=testonly

Automatic update from web-platform-tests
Shared Storage: Add non-live dataOption to createWorklet for use counter

We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxiachromium.org>
Commit-Queue: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1318000}

--

wpt-commits: 25b56c5748119452697daf6903523c3523fbb64a
wpt-pr: 46853

UltraBlame original commit: 9d3e2f74487b035e80c69a330be89ef279bd2862
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Jul 1, 2024
…to createWorklet for use counter, a=testonly

Automatic update from web-platform-tests
Shared Storage: Add non-live dataOption to createWorklet for use counter

We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxiachromium.org>
Commit-Queue: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1318000}

--

wpt-commits: 25b56c5748119452697daf6903523c3523fbb64a
wpt-pr: 46853

UltraBlame original commit: 9d3e2f74487b035e80c69a330be89ef279bd2862
aarongable pushed a commit to chromium/chromium that referenced this pull request Jul 3, 2024
…ss-origin script

Why: We proposed a potentially breaking change to addModule() in
WICG/shared-storage#158. That is, currently,
a website can call addModule() everywhere and expect it to fail when
they're not in their own context; however, with cross-origin script
support, these calls could unexpectedly succeed.

Thus, we track potentially non-forward-compatible addModule() usages to
assess the potential impact and guide further decisions. We anticipate
this usage to be low.

Bug: 350764023
Change-Id: I5da4583ed583baa398bdb2cadf8955d341474050
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5665746
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Sun Yueru <yrsun@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1322541}
sadym-chromium pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 18, 2024
We proposed a breaking change to sharedStorage.createWorklet() in
WICG/shared-storage#158.

We add a use counter for how frequently createWorklet is called in a
non-forward-compatible way according to the proposal (i.e. with a
cross-origin script but without the option dataOrigin: "script-
origin"). This will help us determine what the impact of this change
would be.

Bug: 348445878
Change-Id: I3b882a9ec859beb5265ba31d3169fb5e1239cac4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5645568
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1318000}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 25, 2024
The same-origin restriction for module script loaded by
`sharedStorage.worklet.addModule()` is no longer needed, so we remove
it. See WICG/shared-storage#158 and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Only cross-origin scripts loaded with createWorklet() that use the
script origin as their data origin will need the
"Shared-Storage-Cross-Origin-Worklet-Allowed: ?1" response header,
however. To differentiate between worklets that need to be
checked for this header and ones that don't, we add a new
"Sec-Shared-Storage-Data-Origin" request header with the data origin
used to the requests where the data origin is cross-origin to the
context origin. We then use this information to determine if the
"Shared-Storage-Cross-Origin-Worklet-Allowed" response header is needed.

Bug: 348660660
Change-Id: I55f7f5d6d282b679505be5f23901f26ff7d7d374
aarongable pushed a commit to chromium/chromium that referenced this pull request Jul 25, 2024
The same-origin restriction for module script loaded by
`sharedStorage.worklet.addModule()` is no longer needed, so we remove
it. See WICG/shared-storage#158 and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Only cross-origin scripts loaded with createWorklet() that use the
script origin as their data origin will need the
"Shared-Storage-Cross-Origin-Worklet-Allowed: ?1" response header,
however. To differentiate between worklets that need to be
checked for this header and ones that don't, we add a new
"Sec-Shared-Storage-Data-Origin" request header with the data origin
used to the requests where the data origin is cross-origin to the
context origin. We then use this information to determine if the
"Shared-Storage-Cross-Origin-Worklet-Allowed" response header is needed.

Bug: 348660660
Change-Id: I55f7f5d6d282b679505be5f23901f26ff7d7d374
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5648386
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332965}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 25, 2024
The same-origin restriction for module script loaded by
`sharedStorage.worklet.addModule()` is no longer needed, so we remove
it. See WICG/shared-storage#158 and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Only cross-origin scripts loaded with createWorklet() that use the
script origin as their data origin will need the
"Shared-Storage-Cross-Origin-Worklet-Allowed: ?1" response header,
however. To differentiate between worklets that need to be
checked for this header and ones that don't, we add a new
"Sec-Shared-Storage-Data-Origin" request header with the data origin
used to the requests where the data origin is cross-origin to the
context origin. We then use this information to determine if the
"Shared-Storage-Cross-Origin-Worklet-Allowed" response header is needed.

Bug: 348660660
Change-Id: I55f7f5d6d282b679505be5f23901f26ff7d7d374
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5648386
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332965}
aarongable pushed a commit to chromium/chromium that referenced this pull request Jul 25, 2024
We previously added `blink::features::kSharedStorageCrossOriginScript`
to gate the Shared Storage API enhancements proposed in
WICG/shared-storage#158 and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

We have since decided, however, to gate the enhancements behind two
separate features. We will use the previously added
`blink::features::kSharedStorageCrossOriginScript` feature to enable
or disable allowing cross-origin scrips in `addModule()`.

This CL add a new feature `blink::features::
kSharedStorageCreateWorkletUseContextOriginByDefault` to gate the
update to `createWorklet() to use its context origin as its data
origin by default, and to hook up the `dataOrigin` option to allow
manually selecting "script-origin" instead of "context-origin".

Bug: 348660660
Change-Id: I95bf7d263c4e37f80ac04899fcd575c799c5fa38
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5739715
Reviewed-by: Kent Tamura <tkent@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332972}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 25, 2024
The same-origin restriction for module script loaded by
`sharedStorage.worklet.addModule()` is no longer needed, so we remove
it. See WICG/shared-storage#158 and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Only cross-origin scripts loaded with createWorklet() that use the
script origin as their data origin will need the
"Shared-Storage-Cross-Origin-Worklet-Allowed: ?1" response header,
however. To differentiate between worklets that need to be
checked for this header and ones that don't, we add a new
"Sec-Shared-Storage-Data-Origin" request header with the data origin
used to the requests where the data origin is cross-origin to the
context origin. We then use this information to determine if the
"Shared-Storage-Cross-Origin-Worklet-Allowed" response header is needed.

Bug: 348660660
Change-Id: I55f7f5d6d282b679505be5f23901f26ff7d7d374
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5648386
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332965}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 25, 2024
We align the default data origin for createWorklet with that of
addModule to be the invoking context's origin. We also hook up the
dataOrigin option in createWorklet's options dictionary, so that
the script origin can be manually specified to be used as the data
origin instead.

See WICG/shared-storage#158,
WICG/shared-storage#161, and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Bug:353738488
Change-Id: I3578e48f14c9fb1005211b94889ce01ef209162c
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 25, 2024
We align the default data origin for createWorklet with that of
addModule to be the invoking context's origin. We also hook up the
dataOrigin option in createWorklet's options dictionary, so that
the script origin can be manually specified to be used as the data
origin instead.

See WICG/shared-storage#158,
WICG/shared-storage#161, and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Bug: 353738488
Change-Id: I3578e48f14c9fb1005211b94889ce01ef209162c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5716903
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333189}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Jul 25, 2024
We align the default data origin for createWorklet with that of
addModule to be the invoking context's origin. We also hook up the
dataOrigin option in createWorklet's options dictionary, so that
the script origin can be manually specified to be used as the data
origin instead.

See WICG/shared-storage#158,
WICG/shared-storage#161, and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Bug: 353738488
Change-Id: I3578e48f14c9fb1005211b94889ce01ef209162c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5716903
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333189}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 30, 2024
…ript in addModule, a=testonly

Automatic update from web-platform-tests
Shared Storage: Allow x-origin module script in addModule

The same-origin restriction for module script loaded by
`sharedStorage.worklet.addModule()` is no longer needed, so we remove
it. See WICG/shared-storage#158 and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Only cross-origin scripts loaded with createWorklet() that use the
script origin as their data origin will need the
"Shared-Storage-Cross-Origin-Worklet-Allowed: ?1" response header,
however. To differentiate between worklets that need to be
checked for this header and ones that don't, we add a new
"Sec-Shared-Storage-Data-Origin" request header with the data origin
used to the requests where the data origin is cross-origin to the
context origin. We then use this information to determine if the
"Shared-Storage-Cross-Origin-Worklet-Allowed" response header is needed.

Bug: 348660660
Change-Id: I55f7f5d6d282b679505be5f23901f26ff7d7d374
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5648386
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Andrey Kosyakov <caseq@chromium.org>
Reviewed-by: Brendon Tiszka <tiszka@chromium.org>
Reviewed-by: Tsuyoshi Horo <horo@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1332965}

--

wpt-commits: c1ba090fe97109f63812fe90a4b612d602f6a87f
wpt-pr: 47290
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Jul 30, 2024
…fault data origin w/addModule's, a=testonly

Automatic update from web-platform-tests
Shared Storage: Align createWorklet's default data origin w/addModule's

We align the default data origin for createWorklet with that of
addModule to be the invoking context's origin. We also hook up the
dataOrigin option in createWorklet's options dictionary, so that
the script origin can be manually specified to be used as the data
origin instead.

See WICG/shared-storage#158,
WICG/shared-storage#161, and
https://groups.google.com/a/chromium.org/g/blink-dev/c/YZ4XGewKVuk.

Bug: 353738488
Change-Id: I3578e48f14c9fb1005211b94889ce01ef209162c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5716903
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1333189}

--

wpt-commits: 71b107815a391a469b081cbb9242e1723ede50fb
wpt-pr: 47296
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants