Screen Wake Lock API
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 WakeLockSentinel/release_event 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
See also
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
