Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The SharedStorageWorklet
interface of the Shared Storage API represents the shared storage worklet for the current origin.
SharedStorageWorklet
does not have its own properties or methods. Rather, it inherits the addModule()
method from the Worklet
interface. This method is used for adding a module.
Unlike a regular Worklet
:
- If the calling site has not included the Shared Storage API in a privacy sandbox enrollment process, calls to
sharedStorageWorklet.addModule()
will be rejected. -
SharedStorageWorklet
allows only a single module to be added, for privacy reasons. Even with a successful enrollment, repeated calls toaddModule()
on the same shared storage worklet will be rejected.
SharedStorageWorklet
is accessed via WindowSharedStorage.worklet
.