Back to Content

WorkletSharedStorage: context property

files/en-us/web/api/workletsharedstorage/context/index.md

latest975 B
Original Source

{{APIRef("Shared Storage API")}}{{deprecated_header}}{{Non-standard_Header}}

The context read-only property of the {{domxref("WorkletSharedStorage")}} interface contains contextual data passed into the shared storage worklet from the associated browsing context via the {{domxref("FencedFrameConfig.setSharedStorageContext()")}} method.

Value

A string representing the data. The value will match the latest value that was passed into the {{domxref("FencedFrameConfig.setSharedStorageContext()")}} method prior to navigation to the {{domxref("FencedFrameConfig")}}. If no value was set by setSharedStorageContext() prior to navigation, then context will return undefined.

Examples

See the main {{domxref("WorkletSharedStorage")}} page for an example.

Specifications

The context property is not currently defined in a specification.

Browser compatibility

{{Compat}}

See also