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 in secure contexts (HTTPS), in some or all supporting browsers.

The clearAppBadge() method of the Navigator interface clears a badge on the current app's icon by setting it to nothing. The value nothing indicates that no badge is currently set, and the status of the badge is cleared.

Syntax

js
clearAppBadge()

Parameters

None.

Return value

A Promise that resolves with undefined.

Exceptions

InvalidStateError DOMException

Thrown if the document is not fully active.

SecurityError DOMException

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

NotAllowedError DOMException

Thrown if PermissionStatus.state is not granted.

Examples

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

js
navigator.clearAppBadge();

Specifications

Specification
Badging API
# clearappbadge-method

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Node.js
clearAppBadge
Chrome – Full support
Chrome 81 (Release date: 2020-04-07)
footnote
footnote Windows and macOS since Chrome 81.
footnote ChromeOS since Chrome 91.
footnote Linux offers no universal badging API on the operating system level.
Edge – Full support
Edge 81 (Release date: 2020-04-13)
footnote
footnote Windows and macOS since Edge 81.
footnote ChromeOS since Edge 91.
footnote Linux offers no universal badging API on the operating system level.
Firefox – No support
Firefox
footnote No support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 17 (Release date: 2023-09-18)
footnote
footnote Badging is supported for installed web apps on macOS Sonoma and higher.
Chrome Android – Full support
Chrome Android 81 (Release date: 2020-04-07)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 58 (Release date: 2020-05-13)
footnote Full support
Safari on iOS – Full support
Safari on iOS 16.4 (Release date: 2023-03-27)
footnote
footnote Badging is supported for web apps saved to the home screen.
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
footnote Full support
WebView Android – Full support
WebView Android 81 (Release date: 2020-04-07)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote
footnote Badging is supported for web apps saved to the home screen.
Node.js – No support
Node.js
footnote No support

Legend

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

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

See also