这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@pythagoraskitty
Copy link
Contributor

We propose adding a way for embedders to write context to the fenced frame config, which will then be available inside shared storage worklets in the fenced frame.

Instead, before navigating the fenced frame to the auction's winning [FencedFrameConfig](https://github.com/WICG/fenced-frame/blob/master/explainer/fenced_frame_config.md), the embedder could write the event-level ID, or other contextual information, as a string, by using the [FencedFrameConfig](https://github.com/WICG/fenced-frame/blob/master/explainer/fenced_frame_config.md)'s `setSharedStorageContext()` method, as in the example below.

Subsequently, anything written through the [FencedFrameConfig](https://github.com/WICG/fenced-frame/blob/master/explainer/fenced_frame_config.md)'s `setContext()` method prior to a fenced frame's navigation to that config, can be read via `sharedStorage.context` from inside a worklet for the [Shared Storage API](https://github.com/WICG/shared-storage) created by the fenced frame or by any of its same-origin children.
Subsequently, anything written through the [FencedFrameConfig](https://github.com/WICG/fenced-frame/blob/master/explainer/fenced_frame_config.md)'s `setSharedStorageContext()` method prior to a fenced frame's navigation to that config, can be read via `sharedStorage.context` from inside a worklet for the [Shared Storage API](https://github.com/WICG/shared-storage) created by the fenced frame or by any of its same-origin children. That is, `sharedStorage.context` can be invoked via the script for a operation previously registered through [`sharedStorage.worklet.addModule()`](https://github.com/WICG/shared-storage/tree/main#outside-the-worklet) and then called by either [`sharedStorage.run()`](https://github.com/WICG/shared-storage/tree/main#outside-the-worklet) or [`sharedStorage.selectURL()`](https://github.com/WICG/shared-storage/tree/main#outside-the-worklet).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we also add the same-origin restriction?

Copy link
Contributor Author

@pythagoraskitty pythagoraskitty Feb 28, 2023

Choose a reason for hiding this comment

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

It notes the same-origin restriction in the previous sentence. Would you like me to repeat it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"from inside a worklet for the Shared Storage API created by the fenced frame or by any of its same-origin children."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just changed "children" -> "descendants" and removed selectURL per the chat discussion.

@shivanigithub shivanigithub merged commit 3289519 into WICG:master Feb 28, 2023
github-actions bot added a commit that referenced this pull request Feb 28, 2023
SHA: 3289519
Reason: push, by shivanigithub

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants