WorkerNavigator:locks 属性

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.

io error: No such file or directory (os error 2) (/home/runner/work/yari/yari/mdn/translated-content/files/zh-cn/web/api/workernavigator/index.md)

安全上下文: 此项功能仅在一些支持的浏览器安全上下文(HTTPS)中可用。

备注: 此特性仅在 Web Worker 中可用。

WorkerNavigator 接口的 locks 只读属性返回一个 LockManager 对象,该对象提供了请求新的 Lock 对象和查询现有的 Lock 对象的方法。

一个 LockManager 对象。

规范

Specification
Web Locks API
# dom-navigatorlocks-locks

浏览器兼容性

BCD tables only load in the browser