草案
此页面不完整。
安全上下文
此特征只可用于
安全上下文
(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.
'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. |
未知 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
完整支持
不支持