- From: Jake Archibald <jaffathecake@gmail.com>
- Date: Fri, 11 Jul 2014 16:17:12 +0100
- To: Webapps WG <public-webapps@w3.org>
- Message-ID: <CAJ5xic9n6BXA0LFRA=UnCShgaj34kPwpy86BP=UWKkKqT6UpJg@mail.gmail.com>
Currently serviceworker-dependent APIs are sitting in navigator.whatever, but now we're adding a ServiceWorkerRegistration object ( https://github.com/slightlyoff/ServiceWorker/issues/365#issue-37477775) it feels like they should live there. So instead of: navigator.serviceWorker.ready.then(function() { navigator.push.register(...) }); it'd be: navigator.serviceWorker.ready.then(function(reg) { reg.push.register(...) }); This should make it clearer that push registrations are dependent on the serviceworker registration. Meaning each serviceworker can have its own push registration, and unregistering a serviceworker means the push is unregistered with it. We're also discussing introducing navigator.serviceWorker.getRegistration(docURL), allowing developers to get any serviceworker registration on the origin. This means a page like "/config/" could register/unregister push for other parts of the origins ("/calendar/", "/messaging/" etc). Does that sound reasonable?
Received on Friday, 11 July 2014 15:17:40 UTC