Example of Twitter with eight notifications and another app showing a flag type badge.
The Badging API allows installed web apps to set an application-wide badge, shown in an operating-system-specific place associated with the application (such as the shelf or home screen).
Badging makes it easy to subtly notify the user that there is new activity that might require their attention, or to indicate a small amount of information, such as an unread count.
Badges tend to be more user-friendly than notifications, and can be updated with a much higher frequency, since they don’t interrupt the user. And, because they don’t interrupt the user, they don’t need the user’s permission.
Examples of sites that may use this API include:
StepStatus1. Create explainerComplete2. Create initial draft of specificationComplete3. Gather feedback & iterate on designComplete4. Origin trialChrome 79-80 In progress5. LaunchChrome 81
The Badging API works on Windows, and macOS. Support for Chrome OS is in development and will be available in a future release of Chrome. On Android, the Badging API is not supported. Instead, Android automatically shows a badge on a web app when there is an unread notification, just as for native apps.
The origin trial is supported in both Chrome 79 and Chrome 80 and runs through September 2020.
Origin trials allow you to try new features and give feedback on their usability, practicality, and effectiveness to the web standards community. For more information, see the Origin Trials Guide for Web Developers. To sign up for this or another origin trial, visit the registration page.
origin-trial
<meta>
tag to the head of each page. For example, this may look something like:<meta http-equiv="origin-trial" content="TOKEN_GOES_HERE">
Origin-Trial
HTTP header. The resulting response header should look something like:Origin-Trial: TOKEN_GOES_HERE
#mobileapp