Shared storageLimited availability
The sharedStorage API stores data to a shared space where the data can then be processed without the ability to track users across the different sites they visit. A common use case is measuring the reach of third-party ads without using user-tracking cookies.
Not yet supported in all major browsers — check the table and provide a fallback.
Discouraged: Following the announcement that Chrome will maintain its current approach to third-party cookies, Chrome decided to withdraw certain Privacy Sandbox features including the shared storage.
Browser support
How to use
Not supported in Chrome, Edge, Firefox, Safari, Chrome Android, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: SharedStorage.
Feature detection
if ("SharedStorage" in globalThis) {
// SharedStorage is available
} else {
// load a polyfill or use a fallback
}Sub-features
Support for each part of the feature (19). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| HTMLIFrameElement.sharedStorageWritable | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| HTMLImageElement.sharedStorageWritable | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.append | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.clear | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.createWorklet | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.delete | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.get | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ | ✕ |
| SharedStorage.run | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.selectURL | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.set | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorage.worklet | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorageWorklet | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorageWorklet.run | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorageWorklet.selectURL | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorageWorkletGlobalScope | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorageWorkletGlobalScope.register | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| SharedStorageWorkletGlobalScope.sharedStorage | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |
| Window.sharedStorage | 126 | 126 | ✕ | ✕ | 126 | ✕ | ✕ |