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

安全上下文
此特征只可用于 安全上下文 (HTTPS),在某些或所有 支持浏览器 .

wakeLock 只读特性返回 WakeLock interface which allows a document to acquire a screen wake lock. While a screen wake lock is active, the user agent will try to prevent the device from dimming the screen, turning it off completely, or showing a screensaver.

句法

const wakeLock = navigator.wakeLock;
					

规范

规范 状态 注释
Screen Wake Lock API 编者草案 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.

No compatibility data found. Please contribute data for "api.Navigator.wakeLock" (depth: 1) to the MDN 兼容性数据存储库 .

另请参阅

元数据

  • 最后修改: