Re: [w3c/ServiceWorker] Add a script version property to the ServiceWorker object (#1387)

> It sounds like this ends up being a variation of #1331. In particular, if a string length limit/grammar isn't imposed on scriptVersion, it seems likely it would end up being used for arbitrary JSON storage, etc.

@asutherland, thanks for pointing me to that issue. I do think a more generic store would help solve my use cases, but actually your comment about `URLSearchParams` made me realize that I could also potentially solve it by recommending our users add a version to the script URL they register (for context, this is regarding a new feature we're adding to [Workbox](https://workboxjs.org)).

> It seems tracking and exposing worker install time (#842) might be another way to satisfy this use case. 

@wanderview yes, I do think an install/registration time property would also be helpful in solving this use case, but I think passing version data in the script URL is probably more helpful. 

There's also still the issue I reported in https://github.com/w3c/ServiceWorker/issues/1379 (when a page calls `.register()` and then it receives an `updatefound` event, there's no good way for the page to know whether its call to register triggered that update); though, if you put script version data in the script URL you register, then not knowing that for sure is much less of a problem.

-- 
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/1387#issuecomment-459490876

Received on Thursday, 31 January 2019 20:19:53 UTC