LockManager

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

LockManager interface of the the Web Locks API provides methods for requesting a new Lock object and querying for an existing Lock object. To get an instance of LockManager , call navigator.locks .

方法

LockManager.request()
Requests a Lock object with parameters specifying its name and characteristics.
LockManager.query()
返回 Promise that resolves with a LockManagerSnapshot which contains information about held and pending locks.

规范

规范 状态 Comment
Web Locks API
The definition of 'LockManager' in that specification.
草案 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
LockManager
Chrome 69 Edge ≤79 Firefox ? IE ? Opera 56 Safari ? WebView Android 69 Chrome Android 69 Firefox Android ? Opera Android 48 Safari iOS ? Samsung Internet Android 10.0
query
Chrome 69 Edge ≤79 Firefox ? IE ? Opera 56 Safari ? WebView Android 69 Chrome Android 69 Firefox Android ? Opera Android 48 Safari iOS ? Samsung Internet Android 10.0
request
Chrome 69 Edge ≤79 Firefox ? IE ? Opera 56 Safari ? WebView Android 69 Chrome Android 69 Firefox Android ? Opera Android 48 Safari iOS ? Samsung Internet Android 10.0

图例

完整支持
完整支持
兼容性未知
兼容性未知
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。