- From: Binyamin Laukstein <notifications@github.com>
- Date: Wed, 31 May 2017 16:41:20 -0700
- To: w3c/ServiceWorker <ServiceWorker@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 31 May 2017 23:41:52 UTC
Current spec https://w3c.github.io/ServiceWorker/#navigator-service-worker-register I want be able to pass custom parameters to ServiceWorker for future use, since localStorage and sessionStorage aren't allowed. It would be grate be able to defined version, URLs to cache, etc. early in `navigator.serviceWorker.register` like: ``` navigator.serviceWorker.register("sw.js", { scope: "/", customParamFoo: "test", bar: { version: "1.2.0", environment: "development" }, urlsToCache: ["style.css", "icon.png"] } ``` and after in sw.js use like: ``` self.registration.customParamFoo; const version = self.registration.bar.version; const urlsToCache = self.registration.urlsToCache; ``` Any early proposal for it? Any reason why not to implement this? -- 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/1157
Received on Wednesday, 31 May 2017 23:41:52 UTC