Re: [w3c/ServiceWorker] consider allowing a non-scope identifier for registrations (#1512)

I think I like the idea of relaxing the link between scopes to service workers.
I am less sure about exposing IDs to web pages though and I am not sure integrating it with register is the best approach.
For instance, what if a web developer wants to replace two existing service workers by three new service workers.

AIUI, the issue is about the ability to dynamically change service worker scopes.
Why not using a lock/unlock approach or exposing an API that would update the scope map atomically?
Something like navigator.serviceWorker.updateScopes({sw1: myScope1, sw2: myScope2, ...})

Let's say we introduce the possibility for a service worker to have a 'null' scope (aka a service worker is registered but has no entry in the scope to registration map).
Scripts could register several new service workers with 'null' scopes, update scopes and unregister old service workers with 'null' scope.

-- 
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-706987378

Received on Monday, 12 October 2020 09:05:32 UTC