tanmayrajani / notifications-preview-github

Browser Extension: preview GitHub notifications with same page pop-overs
https://chrome.google.com/webstore/detail/github-notifications-prev/kgilejfahkjidpaclkepbdoeioeohfmj?hl=en&gl=IN
MIT License
141 stars 15 forks source link

Use Badging API if available to update the app badge #115

Closed karlhorky closed 3 years ago

karlhorky commented 3 years ago

Hi there, thanks for this extension, really cool!

Using the Badging API (spec, shipped to stable Chrome in April 2020), navigator.setAppBadge(notificationsCount) and navigator.clearAppBadge() can set and clear the application badge that shows up with PWA and pseudo-PWA windows (create a pseudo-PWA with three dots menu -> More Tools -> Create Shortcut... -> Open as window).

On macOS this looks like this in the Dock:

Screen Shot 2020-12-08 at 15 11 36

fregante commented 3 years ago

This extension only works when the tab is visible, so the badge wouldn’t be updated if the window is minimized. You might want to ask this in https://github.com/sindresorhus/notifier-for-github

karlhorky commented 3 years ago

Ah, thanks for the tip! Opened a new issue over there: https://github.com/sindresorhus/notifier-for-github/issues/235