[w3c/ServiceWorker] Proposal: pass custom params in ServiceWorkerRegistration for future use (#1157)

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