WakeLockSentinel.onrelease
Draft
This page is not complete.
Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
The onrelease
property of the
WakeLockSentinel
is fired when the sentinel object's handle has been
released.
A WakeLockSentinel
can be released manually via the release() method, or
automatically via the platform wake lock. This can happen if the document becomes
inactive or looses visibility, if the device is low on power or the user turns on a
power save mode.
This interface inherits from the Event
interface.
Syntax
wakeLockSentinel.onrelease = function(event) {...}
Examples
This example updates the UI should the wake lock be released.
wakeLock.addEventListener('release', () => {
// if wake lock is released alter the UI accordingly
statusElement.textContent = 'Wake Lock has been released';
});
Specifications
Specification | Status | Comment |
---|---|---|
Screen Wake Lock API The definition of 'onrelease' in that specification. |
Editor's Draft | Initial definition. |
Browser compatibility
BCD tables only load in the browser