草案
此页面不完整。

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

只读 type 特性为 WakeLockSentinel interface returns a 字符串 representation of the currently acquired WakeLockSentinel 类型。

句法

var type = WakeLockSentinel.type;
					

A 字符串 representation of the currently acquired wake lock type.

type 只读
Return values are:
  • 'screen' : A screen wake lock. Prevents devices from dimming or locking the screen.

范例

This example shows an asynchronous function that acquires a WakeLockSentinel , then logs the type to the console.

const requestWakeLock = async () => {
  wakeLock = await navigator.wakeLock.request('screen');
  console.log(wakeLock.type); // logs 'screen'
};
requestWakeLock();
					

规范

规范 状态 注释
Screen Wake Lock API
The definition of 'WakeLockType' in that specification.
未知 初始定义。

浏览器兼容性

The compatibility table in 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. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
type Chrome 84 Edge 84 Firefox No IE No Opera Yes Safari No WebView Android 84 Chrome Android 84 Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

元数据

  • 最后修改: