App Badging API Demo

The App Badging API is a new web platform API that 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).

Unless manually set (See Set app badge in page), the badge shows the number of requests that have been made and intercepted by the service worker since it started.

Sorry! This browser doesn't appear to support the badging API.

Note: In order for this demo to work, it must be an installed Progressive Web App. It also requires the Notifications permission on some platforms.

Set app badge in page


Set app badge in background (via service worker)

Increment the badge value by opening another window to this page, or clicking the Make XHR button.

Check out the source for this sample, or remix it on Glitch.