PSA: service worker based extensions can test “silent” push messages

192 views
Skip to first unread message

Justin Lulejian

unread,
Dec 20, 2023, 6:53:02 PM12/20/23
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

Jackie Han

unread,
Dec 20, 2023, 9:30:17 PM12/20/23
to Chromium Extensions
This email went into my Gmail spam folder. Just bring it back in case anyone else didn't see it.

PS: recently, there has been a lot of spam in this forum, most of which go to the spam folder, but a small number of non-spam emails are incorrectly marked as spam like this.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/7ca85820-a1ff-44fc-ae3b-6fb65b19543an%40chromium.org.
Message has been deleted

Jackie Han

unread,
Dec 21, 2023, 11:52:38 AM12/21/23
to Chromium Extensions
Your reply went off the original topic, so I created a different title.

Recently, there has been a lot of spam in this forum, most of which go to the spam folder, but a small number of non-spam emails are incorrectly marked as spam. Note: these spam emails happened in the last few days.

Usually, people who post in this forum for the first time need to be manually reviewed. And people who send spam will be banned quickly. So it's not much about spam here, it's more about management issues.

---------- Forwarded message ---------
From: wOxxOm <wox...@gmail.com>
Date: Thu, Dec 21, 2023 at 9:57 PM
Subject: Re: [crx] PSA: service worker based extensions can test “silent” push messages
To: Chromium Extensions <chromium-...@chromium.org>
Cc: Jackie Han <han.g...@gmail.com>


You can't directly influence Gmail's algorithm outside of your own inbox. Gmail marks these messages as spam because thousands (or millions) of users have been marking spam messages from these groups for years, which has created a strong algorithmical bias. There's no solution currently until a better spam filter is invented that prevents posting spam altogether.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages