0

I followed Google's codelab "Adding Push Notifications to a Web App" (https://developers.google.com/web/fundamentals/codelabs/push-notifications/) - it works with Chrome.

But in Firefox 55 no notification shows up when I press the "Test Push Notification" button in about:debugging#workers, though in the console "[Service Worker] Push Received." is outputted.

No idea where to investigate first... Anyone can help?

R0byn
  • 363
  • 5
  • 15
  • 1
    You need to check the console for errors. Note that the relevant console is that attached to the service worker: http://blog.pushpad.xyz/2017/10/debugging-service-workers-and-push-with-firefox/ Also make sure that the SW code is updated to the latest version (you can inspect the source code of the service workers from the developer tools). Finally note that some browser / versions don't support the notification payload and you only receive a signal. – collimarco Oct 04 '17 at 10:20

1 Answers1

1

Yay, I found the reason why Firefox didn't show the notification. It's in this original line from Google codelab:

console.log(`[Service Worker] Push had this data: "${event.data.text()}"`);

Firefox seems to dislike the ` but doesn't throw any warning or error in the service worker's console.

R0byn
  • 363
  • 5
  • 15