I've successfully built a service worker that receives push notifications following this tutorial.
And I was trying to build a chrome extension that would allow me to subcripe to the push notifications. But it seems that when the extension runs the service worker is not supported.
Service Worker Error :^( DOMException: Failed to register a ServiceWorker: The URL protocol of the current origin ('chrome-extension://dghajjpcbhcpnnkkgehjhhceemhcacoc') is not supported.
Am I missing some permissions on the manifest.js?
I followed this tutorial for the Chrome extension.
By default, Chrome alerts you whenever a website, app, or extension wants to send you notifications. You can change this setting at any time.
Use the chrome. notifications API to create rich notifications using templates and show these notifications to users in the system tray.
Enabling Service Workers for Chrome extensions is still a work in progress. You can track it here. It seems that it is already available in the Canary and Dev channels.
You don't need a Service Worker to be able to receive push notifications in a Chrome extension. You can use the chrome.gcm
API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With