coderef

LocksBaseline · Widely available

The navigator.locks API coordinates work with shared resources through mutually exclusive ownership of a resource's name. Also known as web locks.

Supported in all major browsers for at least 30 months — safe to use without fallbacks. Baseline since Mar 14, 2022. Widely available since Sep 14, 2024.

Browser support

DesktopChrome
1–68Not supported
69+Supportedsince Sep 4, 2018
Current: 155
Edge
12–18Not supported
79+Supportedsince Jan 15, 2020
Current: 154
Firefox
1–95Not supported
96+Supportedsince Jan 11, 2022
Current: 157
Safari
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27
MobileChrome Android
18–68Not supported
69+Supportedsince Sep 4, 2018
Current: 155
Firefox Android
4–95Not supported
96+Supportedsince Jan 11, 2022
Current: 157
Safari iOS
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27

How to use

This feature is Baseline widely available — use it freely, no fallback needed.

Example

Full syntax and examples are on MDN: Lock.

Feature detection

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

Sub-features

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

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
Lock69799615.4699615.4
Lock.mode69799615.4699615.4
Lock.name69799615.4699615.4
LockManager69799615.4699615.4
LockManager.query69799615.4699615.4
LockManager.request69799615.4699615.4
Navigator.locks69799615.4699615.4
WorkerNavigator.locks69799615.4699615.4