LockManager
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.
Secure context: This feature is available only insecure contexts (HTTPS), in some or allsupporting browsers.
Note: This feature is available inWeb Workers.
TheLockManager interface of theWeb Locks API provides methods for requesting a newLock object and querying for an existingLock object. To get an instance ofLockManager, callnavigator.locks.
In this article
Instance methods
LockManager.request()Requests a
Lockobject with parameters specifying its name and characteristics.LockManager.query()Returns a
Promisethat resolves with an object that contains information about held and pending locks.
Specifications
| Specification |
|---|
| Web Locks API> # api-lock-manager> |