WakeLockSentinel.type

Draft
This page is not complete.

Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The read-only type property of the WakeLockSentinel interface returns a String representation of the currently acquired WakeLockSentinel type.

Syntax

var type = WakeLockSentinel.type;

Value

A String representation of the currently acquired wake lock type.

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

Examples

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();

Specifications

Specification Status Comment
Screen Wake Lock API
The definition of 'WakeLockType' in that specification.
Unknown Initial definition.

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
typeChrome Full support 84Edge Full support 84Firefox No support NoIE No support NoOpera Full support YesSafari No support NoWebView Android Full support 84Chrome Android Full support 84Firefox Android No support NoOpera Android Full support YesSafari iOS No support NoSamsung Internet Android Full support Yes

Legend

Full support
Full support
No support
No support