Search code examples
javascriptfirebasefirefoxweb-push

Firefox not opening window in service worker for Push message


Firebase Cloud Messaging

I have everything setup, the Push messages are received fine and when I click on it, it opens new window... but only in Chrome, in Firefox it is not opened.

I have specifically allowed popups, but didn't make any difference.

I was just debugging for 1 hour

self.addEventListener('notificationclick', function(e) {
    console.log("This is printed to console fine");
    clients.openWindow('https://example.com'); // this makes no error, nothing
});

Any ideas?

Works in Firefox 47.0

Doesn't work in Firefox Quantum 60

Subscribed a bug.


Solution

  • I removed from the service worker:

    const messaging = firebase.messaging();
    

    And it is now working.

    This is just nuts.