w3c / ServiceWorker

Service Workers
https://w3c.github.io/ServiceWorker/
Other
3.63k stars 312 forks source link

Add ServiceWorker.prototype.registration #798

Open annevk opened 8 years ago

annevk commented 8 years ago

Would be kind of convenient to have a pointer to a ServiceWorker's corresponding ServiceWorkerRegistration instance. Or is it too problematic that you can then get to it synchronously from the controller?

wanderview commented 8 years ago

Even if its async, it would be nice to conclusively get the registration managing the ServiceWorker object. Currently things like getRegistration() could conceivably give you a different registration.

jakearchibald commented 8 years ago

Not against adding this unless the synchronous nature (or circular reference) is problematic.