Navigator: clearAppBadge() メソッド

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Navigator インターフェイスの clearAppBadge() メソッドは、現在のアプリケーションのアイコンに設定されているバッジを nothing に設定し、非表示にします。値 nothing は現在バッジが設定されていないことを表し、バッジの状態は cleared になります。

構文

js
clearAppBadge()

引数

なし

返値

undefined で解決する Promise を返します。

例外

NotSupportedError DOMException

Navigator に操作を実行する対象のドキュメントが無いとき投げられます。

アプリケーション内の全メッセージが読まれたら、clearAppBadge() を呼び出してバッジを非表示にし、通知を消去します。

js
navigator.clearAppBadge();

仕様書

Specification
Badging API
# clearappbadge-method

ブラウザーの互換性

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
Node.js
clearAppBadge

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
See implementation notes.

関連情報