dom / latest / wakelocksentinel / release.html /

WakeLockSentinel.release()

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 release 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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
release
84
84
No
No
70
No
84
84
No
60
No
14.0

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/WakeLockSentinel/release