- From: Ben Kelly <notifications@github.com>
- Date: Thu, 13 Aug 2020 07:31:33 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 13 August 2020 14:31:46 UTC
I think I am going to try to spec an option to replace registrations with conflicting scopes. Thinking about my conversations with partners I think its very high probability to be used/needed. I'm thinking an enum, though, instead of a boolean. So something like: ```javascript navigator.serviceWorker.register('sw.js', { scope: '/foo', scopeConflict: 'unregister', }); ``` This would auto-unregister any conflicting service workers before installing the new service worker. If the installation fails, then you would end up with neither the new service worker nor the old conflicting registration. Doing an atomic replace after install is much more complex and I'm not sure its worth it. I think "unregister" will communicate this behavior a bit better than "replace". If we find we need an atomic replace in the future we can add another enum value for it. Thoughts? -- 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/1512#issuecomment-673513467
Received on Thursday, 13 August 2020 14:31:46 UTC