7

I'm using Firefox Nightly of 46.0a1 version (there is only 42v. for OS X, and Push API requires 43v).

And I'm getting this error:

DOMException [AbortError: "Error retrieving push subscription"
code: 20
nsresult: 0x80530014]

Here is snippet where this error in thrown:

navigator.serviceWorker.ready.then(function (serviceWorkerRegistration) {

    serviceWorkerRegistration.pushManager.subscribe()
        .then(function (subscription) {
            endpoint = subscription.endpoint;
            console.log('subscription endpoint: ', subscription.endpoint);
            subscribeOnServer();
        })
        .catch(function (e) {

            // here that error is raised

            errorNotification.innerHTML = 'Unable to subscribe to push';
        }
    });
});

In Chrome this place doesn't throw anything and I get subscription with a properly endpoint.

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
Mihail Zheludev
  • 166
  • 3
  • 10
  • 1
    I've had simmilar error. Enabling all flags `dom.push.*` in `about:config` helped. – Martin Ždila Apr 14 '16 at 15:12
  • dom.push.adaptive.enabled did work for me – Ilya Kochetov May 07 '18 at 21:05
  • I got stuck with this also however since the default serviceworker and push were not enabled on Firefox, so I updated about:config then this message appears AbortError: Error retrieving push subscription this resolved with me after restarting Firefox, I think the new configurations will not be applied until restarting I know it's old question and it's a difference version of Firefox sure however maybe this was the same situation – Alsemany Jan 15 '20 at 17:47

3 Answers3

3

I have recently found that this error may rise if your browser is behind a proxy which does not support web sockets (push service uses web sockets internally).

Michael
  • 301
  • 3
  • 8
1

It doesn't throw for me.

There was a syntax error in your snippet, but I guess that wasn't the issue (otherwise it would have failed in Chrome as well).

Here's the snippet I've used:

navigator.serviceWorker.ready
.then(function(serviceWorkerRegistration) {
  console.log('asd');
  serviceWorkerRegistration.pushManager.subscribe()
  .then(function(subscription) {
    endpoint = subscription.endpoint;
    console.log('subscription endpoint: ', subscription.endpoint);
  })
  .catch(function(e) {
    console.log(e);
  });
});
sideshowbarker
  • 81,827
  • 26
  • 193
  • 197
Marco Castelluccio
  • 10,152
  • 2
  • 33
  • 48
0

I got this error when my service-worker had errors(tried to access non existant store in indexedDb) and so even though it installed but push notifications were not getting subscribed with above error.

Shishir Arora
  • 5,521
  • 4
  • 30
  • 35