Reproduced as of 126.0.0
Steps:
- Start server.go (this receives and stores the push tokens)
- Install the extension
- Close Chrome
- Start Chrome and make sure to open a different user profile
- Trigger a notification
- See the "This site has been updated in the background" notification
- Open the profile that has the extension installed
- Trigger another notification
- Don't see the background notification
Notifications are stored in subscriptions.txt
in the server directory.
cd server
go run server.go
- Clone this repo
- Open
chrome://extensions/
in Chrome - Enable Developer mode
- Click "Load unpacked"
- Select the
extension
directory
cd server
go run server.go send
The script will also automatically clean up old subscriptions.
The fix appears to be to call registration.pushManager.subscribe()
in the main runloop of the service worker. Calling that before the service worker is activated does throw an error, so it needs to be caught. But it does appear to silence the background notification.
Uncomment line 5 in mv3.js
and try it again.