WakeLockSentinel.release()

Draft
This page is not complete.

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

The release() method of the WakeLockSentinel interface releases the WakeLockSentinel, returning a Promise that is resolved once the sentinel has been successfully released.

Syntax

WakeLockSentinel.release().then(...);

Parameters

None.

Return value

Returns a Promise that resolves with undefined

Exceptions

No exceptions are thrown. You should always listen for the onrelease event to check if a wake lock has been released.

Examples

In this example, when a user clicks a button the WakeLockSentinel is released.

wakeLockOffButton.addEventListener('click', () => {
  WakeLockSentinel.release();
})

Specifications

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

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
releaseChrome 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

See also