Link to explainer. (Note: I have requested to move this explainer repo into WICG.)
Allows web applications (as defined by the Web App Manifest standard) to set an application-wide badge, shown in an operating-system-specific place associated with the application (such as the shelf or home screen). The badge can show a positive integer or a single character over the top of the application icon.
Showing a badge for something like a simple status or unread count is a standard feature of desktop and mobile app platforms, which represents missing functionality when developers choose to build an installable web app (PWA) over a native app.
“What are web developers are forced to do without it?”
There is no way to modify the shelf icon in an installed PWA (note: modifying the window’s favicon generally doesn’t affect the shelf icon, which is based on the static icon from the manifest). Developers are forced to build Electron apps instead of PWAs to get this functionality (and we see Electron apps like Slack and Hangouts Chat which could be PWAs if this and other APIs were available on the web).
Interoperability and Compatibility
The usual risk that it fails to become an interoperable part of the web platform if other browsers do not implement it. Risk somewhat mitigated by the fact that the API is trivially feature-detectable and graceful degradation is easy (the badge simply doesn’t appear on platforms where the API is not supported). Not having this API can’t break any functionality that would have been possible without this API.
Potential interoperability improvement, if Microsoft is on board, because currently PWAs accessed through Edge can only achieve this capability using the Windows.UI.Notifications.BadgeNotification API.
Edge: No signals (though note that equivalent proprietary API already web-exposed)
Firefox: No signals
Safari: No signals
We’ll be reaching out to other vendors shortly.
Are there any other platform APIs this feature will frequently be used in tandem with?
Yes, Notifications. An app will often want to send a notification at the same time as a badge, to indicate that new content is available in the app. However, this is separate from Notifications, as it’s also possible for an app to show a badge without a notification (which is like a more subtle type of notification).
Could the default usage of this API make it hard for Chrome to maintain good performance?
No; it will be used infrequently by sites and will have no performance overhead when not being used.
Will it be challenging for developers to take advantage of this feature immediately, as-is?
No, it’s simple and easy to hook up to existing apps.
Would this feature benefit from having polyfills, significant documentation and outreach, and/or libraries built on top of it to make it easier to use?
Outreach would help. Polyfills won’t be able to fill the gap because the functionality cannot be achieved without this API being implemented in the browser. It’s unlikely that further abstraction is required. The proposed API is very simple.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes, eventually. However, it requires individual implementation on each platform, so we would have to move slowly and not launch all at once. See explainer for details on how it would be implemented on each platform.
Link to entry on the feature dashboard
Requesting approval to ship?
small quibble/clarificationWindows.UI.Notifications.BadgeNotification is only exposed inside of apps using a edge webview (which is how installed PWAs work), they are not exposed on the web as a whole
+1 in general - thanks for writing it up matt!
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/1b0b97d3-ff74-4b88-b350-1aa2381265e9%40chromium.org.