WakeLockSentinel.release()
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
安全なコンテキスト用: この機能は一部またはすべての対応しているブラウザーにおいて、安全なコンテキスト (HTTPS) でのみ利用できます。
release()
は WakeLockSentinel
インターフェイスのメソッドで、 WakeLockSentinel
を返し、この見張り (sentinel) の解放に成功したら解決する Promise
を返します。
構文
js
WakeLockSentinel.release().then(...);
引数
なし。
返値
undefined
で解決する Promise
を返します。
例外
例外は発生しません。起動ロックが解放されたかどうかを確認するには release
イベントを待ち受けしてください。
例
この例では、ユーザーがボタンをクリックすると WakeLockSentinel
が解放されます。
js
wakeLockOffButton.addEventListener("click", () => {
WakeLockSentinel.release();
});
仕様書
Specification |
---|
Screen Wake Lock API # the-release-method |
ブラウザーの互換性
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
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.