-
Notifications
You must be signed in to change notification settings - Fork 200
Add a Badging feature #2360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a Badging feature #2360
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can we deal with the lack of support in Edge and Chrome here?
BCD says it's partial, and I think that's because you're first required to install the app as a PWA on desktop. Then it works. See the LMC docs and MDN docs about this.
Developers who want to use badges most likely want to do so in context of an installed PWA. That's because badges don't do anything in standard browser tabs otherwise.
One option: add a new BCD subfeature called something like api.Navigator.setAppBadge.on_installed_desktop_pwa and set it as fully supported on Chrome and Edge desktop, and then use that subfeature here. Or, perhaps define two features: one like the one you have here, unchanged, and another one called app-badging.yml, which uses the new api.Navigator.setAppBadge.on_installed_desktop_pwa.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're ok with creating two features, then we can merge this PR as is, and then create a follow-up PR for the PWA-specific feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think BCD has set this to partial because it is Windows and macOS only, missing Linux.
https://chromestatus.com/feature/6068482055602176 says:
Shipped on Windows, macOS and ChromeOS.
Android and Linux support are unlikely as those platforms don't have a comparable badge API. (Linux has one on some window managers but nothing universal; Android's Badge API is tied to notifications and only allows badges to be suppressed, not activated.)
So, I would say BCD should set it to full support for Chrome Desktop and Edge Desktop given it is implemented as much as the current operating systems allow it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mdn/browser-compat-data#25375 updated the Chromium status for setAppBadge (no longer partial). I guess I should have set the same for clearAppBadge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ddbeck
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready to land, now that the changes have been merged upstream.
I did have one (optional) suggestion for the description, but I think you're free to merge when it's ready.
Co-authored-by: Daniel D. Beck <daniel@ddbeck.com>
No description provided.