functional-samples/cookbook.push/README.md
This sample demonstrates using the Push API with self.registration.pushManager.subscribe() and specifically how to use userVisibleOnly to silence required notifications when receiving a push message in a service worker based extension.
By calling a method in the sample and using an external push server website we can simulate an extension receiving a push message where it is not required to emit a notification by setting (userVisibleOnly = false) on registration.
Note: This sample requires Chrome 132+. Before Chrome 132, the same code works with the additional requirement of the notification extension permission.
APPLICATION_SERVER_PUBLIC_KEY variable in background.js.await subscribeUserVisibleOnlyFalse();