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

> having registrations named using a site-provided id lets one create "v1" and "v2" registrations

A website can get the registration for a given scope, post message to the corresponding service worker which will post message back its version. For instance, the version value could be baked into JS script, which might be handy to handle DOM cache versioning.
Isn't this good enough or are we trying to make it more convenient to web pages?
How is it done with frameworks like workbox?
I am sure there are other ways to attach arbitrary metadata to a service worker registration.

I am not sure how a web site can be sure that an ID it gave to register will exactly refer to the registration object the page is thinking of in multi-process architectures? Say we get registration.id and plan to use it, but take enough time that another page uses to unregister/register registrations with the same ID.

Do IDs need to be given by web pages? Can/should they be generated by the user agent?

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

Received on Tuesday, 13 October 2020 19:20:17 UTC