coderef

Shared storage locksLimited availability

The withLock option to set(), append(), delete(), clear(), and batchUpdate() methods of the sharedStorage API prevents duplicate reporting from cross-site race conditions.

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 shared storage locks.

Browser support

DesktopChrome
1–133Not supported
134+Supportedsince Mar 4, 2025
Current: 155
Edge
12–133Not supported
134+Supportedsince Mar 6, 2025
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–133Not supported
134+Supportedsince Mar 4, 2025
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, 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 — see the links below.

Feature detection

JS · check before using
if ("SharedStorageAppendMethod" in globalThis) {
  // SharedStorageAppendMethod is available
} else {
  // load a polyfill or use a fallback
}

Sub-features

Support for each part of the feature (10). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
SharedStorage.batchUpdate134134✕✕134✕✕
SharedStorageAppendMethod134134✕✕134✕✕
SharedStorageAppendMethod.SharedStorageAppendMethod134134✕✕134✕✕
SharedStorageClearMethod134134✕✕134✕✕
SharedStorageClearMethod.SharedStorageClearMethod134134✕✕134✕✕
SharedStorageDeleteMethod134134✕✕134✕✕
SharedStorageDeleteMethod.SharedStorageDeleteMethod134134✕✕134✕✕
SharedStorageModifierMethod134134✕✕134✕✕
SharedStorageSetMethod134134✕✕134✕✕
SharedStorageSetMethod.SharedStorageSetMethod134134✕✕134✕✕