Web/API/WakeLockSentinel/release

From Get docs

Draft This page is not complete.


Secure contextThis 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 APIThe definition of 'release()' in that specification. Editor's Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet

release

Experimental'

Chrome

Full support 84

Edge

Full support 84

Firefox

No support No

IE

No support No

Opera

Full support Yes

Safari

No support No

WebView Android

Full support 84

Chrome Android

Full support 84

Firefox Android

No support No

Opera Android

Full support Yes

Safari iOS

No support No

Samsung Internet Android

No support No

Legend

Full support  
Full support
No support  
No support
Experimental. Expect behavior to change in the future.'
Experimental. Expect behavior to change in the future.


See also