Skip to content

Commit

Permalink
Merge pull request #178 from WICG/177-explainer-resolvetoconfig-optio…
Browse files Browse the repository at this point in the history
…n-is-not-described-in-the-bullet-describing-supported-options

[Explainer] Mention `resolveToConfig` in list of supported options
  • Loading branch information
pythagoraskitty authored Sep 4, 2024
2 parents 1e6f0d7 + 69804ce commit 82e2846
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,16 @@ The shared storage worklet invocation methods (`addModule`, `run`, and `selectUR
* The `url` of the first dictionary in the list is the `default URL`. This is selected if there is a script error, or if there is not enough budget remaining.
* The reporting metadata will be used in the short-term to allow event-level reporting via `window.fence.reportEvent()` as described in the [Protected Audience explainer](https://github.com/WICG/turtledove/blob/main/Fenced_Frames_Ads_Reporting.md).
* There will be a per-[site](https://html.spec.whatwg.org/multipage/browsers.html#site) (the site of the Shared Storage worklet) budget for `selectURL`. This is to limit the rate of leakage of cross-site data learned from the selectURL to the destination pages that the resulting Fenced Frames navigate to. Each time a Fenced Frame navigates the top frame, for each `selectURL()` involved in the creation of the Fenced Frame, log(|`urls`|) bits will be deducted from the corresponding [site](https://html.spec.whatwg.org/multipage/browsers.html#site)’s budget. At any point in time, the current budget remaining will be calculated as `max_budget - sum(deductions_from_last_24hr)`
* The promise resolves to a fenced frame config only when `resolveToConfig` property is set to `true`. If the property is set to `false` or not set, the promise resolves to an opaque URN that can be rendered by an iframe.
* Options can include:
* The promise resolves to a [fenced frame config](https://github.com/WICG/fenced-frame/blob/master/explainer/fenced_frame_config.md) only when the `resolveToConfig` property is set to `true`. If the property is set to `false` or not set, the promise resolves to an opaque URN that can be rendered by an iframe.
* Options for both `run()` and `selectURL()` can include:
* `data`, an arbitrary serializable object passed to the worklet.
* `keepAlive` (defaults to false), a boolean denoting whether the worklet should be retained after it completes work for this call.
* If `keepAlive` is false or not specified, the worklet will shutdown as soon as the operation finishes and subsequent calls to it will fail.
* To keep the worklet alive throughout multiple calls to `run()` and/or `selectURL()`, each of those calls must include `keepAlive: true` in the `options` dictionary.
* Additional supported options for `selectURL()` can include:
* `resolveToConfig` (defaults to false), a boolean denoting whether the returned promise resolves to a fenced frame config.
* If `resolveToConfig` is false or not specified, the returned promise resolves to an opaque URN that can be rendered by an iframe.
* If `resolveToConfig` is true, the returned promise resolves to a [fenced frame config](https://github.com/WICG/fenced-frame/blob/master/explainer/fenced_frame_config.md).
* `window.sharedStorage.run(name, options)`, \
`window.sharedStorage.selectURL(name, urls, options)`, …
* The behavior is identical to `window.sharedStorage.worklet.run(name, options)` and `window.sharedStorage.worklet.selectURL(name, urls, options)`.
Expand Down

0 comments on commit 82e2846

Please sign in to comment.