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
clearAppBadge()
Parameters
None.
Return value
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 notgranted
.
Examples
Once all messages in an application have been read, call clearAppBadge()
to clear the badge and remove the notification.
navigator.clearAppBadge();
Specifications
Specification |
---|
Badging API # clearappbadge-method |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | server | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
clearAppBadge |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
- See implementation notes.