- From: Ben Kelly <notifications@github.com>
- Date: Fri, 06 Oct 2017 20:37:35 +0000 (UTC)
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 6 October 2017 20:38:00 UTC
Consider a service worker that looks like this: ``` self.addEventListener('activate', evt => evt.waitUntil(clients.claim())); ``` And then a main page that waits for a window to be controlled: ``` navigator.serviceWorker.register('sw.js'); await waitForControlled(existingWindow); ``` This works fine if the SW is installed fresh. If the registration resurrects a service worker that was previously unregistered, then this code will break. The activate event will not fire and the claim() will not occur. Should we consider firing another `activate` event or some other new event when the service worker is resurrected like this? It seems that the intent of restoring the SW to the active slot is that it should be equivalent to registering the new worker. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/ServiceWorker/issues/1204
Received on Friday, 6 October 2017 20:38:00 UTC