WakeLockSentinel: release() method
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
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
release()
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
Specification |
---|
Screen Wake Lock API # the-release-method |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
release |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Partial support
- Partial support