W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2014

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

From: Jungkee Song <jungkees@gmail.com>
Date: Mon, 14 Jul 2014 11:55:35 +0900
Message-ID: <CAGwV++cXzPr3wbGFJUgfpkCPgNQBmykVkB-Yczpa=tb4_akRSQ@mail.gmail.com>
To: Jake Archibald <jaffathecake@gmail.com>
Cc: public-webapps <public-webapps@w3.org>, Jonas Sicking <jonas@sicking.cc>
On Jul 12, 2014 2:11 AM, "Jake Archibald" <jaffathecake@gmail.com> wrote:
>
> On 11 July 2014 17:59, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> On Fri, Jul 11, 2014 at 8:17 AM, Jake Archibald <jaffathecake@gmail.com>
wrote:
>> > navigator.serviceWorker.ready.then(function(reg) {
>> >   reg.push.register(...)
>> > });
>>
>> I agree this looks good. Though maybe
>>
>> reg.registerPush(...)
>>
>> instead?
>
>
> .push also has .unregister, will probably have .hasPermission too.
>

Other Service Worker dependent specs may want to do the same, so each API
having its own namespace seems good. e.g:

// IDL
partial interface ServiceWorkerRegistration {
  readonly attribute TaskScheduler taskScheduler;
}

partial interface ServiceWorkerGlobalScope {
  attribute EventHandler onalarm;
};

// JS
navigator.serviceWorker.ready.then(function(reg) {
  reg.taskScheduler.add(Date.now() + (10 * 60000), ...);
});

> (the current spec has .registrations, but I believe one registration per
serivceworker is the rule now)
Received on Monday, 14 July 2014 02:56:02 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:26 UTC