Re: [whatwg] [Notifications] Persistent notifications depending on Service Workers

On Tue, Aug 5, 2014 at 5:04 PM, Peter Beverloo <beverloo@google.com> wrote:
> On Tue, Aug 5, 2014 at 3:48 PM, Anne van Kesteren <annevk@annevk.nl> wrote:
>> Is that available within a service worker?
>
> It would be reasonable to expose it, but it currently isn't (afaik).

Okay, we'd need to sort that out somehow.


> Defaulting to the current Service Worker sounds good.
>
> One case Jake and I thought of was if/when a Service Worker could get
> registrations for other SWs in the origin, but that's only a theoretical
> case today.

I guess if that becomes available you could override it. That would work.


>> We could throw a TypeError. (DOMError is not a thing.) Equivalent to
>> what happens when you get the type wrong.
>
> I think it would be nice to be able to distinguish the invalid-value-type
> case from the no-service-worker case, wouldn't you lose that by throwing
> TypeErrors in both cases?

It seems like you should just wait for the .ready promise, no? What is
a scenario where you'd look at the error and do something different
that's not clearly a bug?


I filed https://github.com/whatwg/notifications/issues/19 to track
this by the way. I got some positive signals from Ehsan at Mozilla.
Would be nice to have a few more before we add it, but I guess there's
not really that many ways to tackle this.


-- 
http://annevankesteren.nl/

Received on Tuesday, 5 August 2014 17:48:59 UTC