Re: [push-api] Moving "PushManager push" onto ServiceWorkerRegistration

2014-07-13 Thread Jungkee Song
On Jul 12, 2014 2:11 AM, "Jake Archibald" wrote: > > On 11 July 2014 17:59, Jonas Sicking wrote: >> >> On Fri, Jul 11, 2014 at 8:17 AM, Jake Archibald wrote: >> > navigator.serviceWorker.ready.then(function(reg) { >> > reg.push.register(...) >> > }); >> >> I agree this looks good. Though maybe

Re: [push-api] Moving "PushManager push" onto ServiceWorkerRegistration

2014-07-11 Thread Jake Archibald
On 11 July 2014 17:59, Jonas Sicking wrote: > On Fri, Jul 11, 2014 at 8:17 AM, Jake Archibald > wrote: > > navigator.serviceWorker.ready.then(function(reg) { > > reg.push.register(...) > > }); > > I agree this looks good. Though maybe > > reg.registerPush(...) > > instead? > .push also has .u

Re: [push-api] Moving "PushManager push" onto ServiceWorkerRegistration

2014-07-11 Thread Jonas Sicking
On Fri, Jul 11, 2014 at 8:17 AM, Jake Archibald wrote: > navigator.serviceWorker.ready.then(function(reg) { > reg.push.register(...) > }); I agree this looks good. Though maybe reg.registerPush(...) instead? / Jonas

Re: [push-api] Moving "PushManager push" onto ServiceWorkerRegistration

2014-07-11 Thread John Mellor
Yes, moving push (especially register, unregister and isRegistered) onto ServiceWorkerRegistration instances would make the API a lot easier to use. Currently it's order dependent, and if a developer tries to register before they have registered a Service Worker, navigator.push.register will rejec

[push-api] Moving "PushManager push" onto ServiceWorkerRegistration

2014-07-11 Thread Jake Archibald
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-3745) it feels like they should live there. So instead of: navigator.serviceWorker.ready.then(funct