Justin Lulejian
unread,Dec 20, 2023, 6:53:02 PM12/20/23Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium Extensions, Devlin Cronin, Oliver Dunk, patrick...@google.com
TLDR: If you have a service worker based extension (MV2 or MV3) that you’d like to use the
Web Push API with please continue reading, otherwise feel free to skip.
Hi everyone,
We recently enabled the ability for service worker based extensions to pass false to userVisibleOnly when subscribing to a push server:
self.registration.pushManager.subscribe({
userVisibleOnly: false,
…
})
This will allow extensions to receive push messages without requiring them to show a notification.
Before this change an extension would be required to show a notification to the user when receiving push messages. If they didn't, a generic one would be shown for them.
For extensions developers that would like to use
Web Push API as a method for client/server communications this hopefully helps make that much more practical due to less noise to the extension user.
The requirements to use this are:
- A service worker based extension
- (As mentioned above) pass `userVisibleOnly: false` when subscribing the extension to the push server
- Possess the `notification` permission (either at runtime or via the manifest)
It is currently
enabled in Canary (121.0.6100.0+), Dev (121.0.6103.3+), and Beta (121.0.6167.8+).
If you want to see an example of this concept please see this
sample extension.
Please let us know any feedback on this change. We hope it improves the developer experience for the better.
Best regards,
CRX team