Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. Navigator
  4. clearAppBadge()

Navigator: clearAppBadge() 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 insecure contexts (HTTPS), in some or allsupporting browsers.

TheclearAppBadge() method of theNavigator interface clears a badge on the current app's icon by setting it tonothing. The valuenothing indicates that no badge is currently set, and the status of the badge iscleared.

Syntax

js
clearAppBadge()

Parameters

None.

Return value

APromise that resolves withundefined.

Exceptions

InvalidStateErrorDOMException

Thrown if the document is not fully active.

SecurityErrorDOMException

Thrown if the call was blocked by thesame-origin policy.

NotAllowedErrorDOMException

Thrown ifPermissionStatus.state is notgranted.

Examples

Once all messages in an application have been read, callclearAppBadge() to clear the badge and remove the notification.

js
navigator.clearAppBadge();

Specifications

Specification
Badging API
# clearappbadge-method

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2026 Movatter.jp