yyx990803 / register-service-worker

A script to simplify service worker registration with hooks for common events.
MIT License
638 stars 58 forks source link

On firefox cached is called instead of updated #49

Open maritaria opened 3 years ago

maritaria commented 3 years ago

Running Firefox 81.0.2.

I have a vue app that uses registerServiceWorker.js, on chrome the updatefound and updated hooks are invoked as expected in order. But for firefox I observe that cached is called instead of updated.

Perhaps firefox has different behaviour for ServiceWorkerRegistration::update(), where the container is set to null for some reason.

This if differs in execution

maritaria commented 3 years ago

It seems that firefox does not automatically (re)start the service worker (left: chrome, right: firefox)

image