W3cubDocs

/Web APIs

SharedStorageWorkletGlobalScope

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The SharedStorageWorkletGlobalScope interface of the Shared Storage API represents the global scope of a SharedStorageWorklet module.

WorkletGlobalScope SharedStorageWorkletGlobalScope

Instance properties

sharedStorage Experimental

Contains an instance of the WorkletSharedStorage object, representing the shared storage for a particular origin as exposed in a worklet context.

Instance methods

register() Experimental

Registers an operation defined inside the current worklet module.

Examples

// ab-testing-worklet.js
class SelectURLOperation {
  async run(urls, data) {
    // Read the user's experiment group from shared storage
    const experimentGroup = await this.sharedStorage.get("ab-testing-group");

    // Return the group number
    return experimentGroup;
  }
}

register("ab-testing", SelectURLOperation);

See the Shared Storage API landing page for a walkthrough of this example and links to other examples.

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
SharedStorageWorkletGlobalScope 126 126 No 112 No 126 No 83 No 28.0 126 No
interestGroups 134 134 No 119 No 134 No 88 No No 134 No
register 126 126 No 112 No 126 No 83 No 28.0 126 No
sharedStorage 126 126 No 112 No 126 No 83 No 28.0 126 No

See also

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/SharedStorageWorkletGlobalScope