Re: [whatwg] Notifications and service workers

On Fri, Sep 26, 2014 at 3:31 PM, Jonas Sicking <jonas@sicking.cc> wrote:
> On Fri, Sep 26, 2014 at 6:23 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
>> On Fri, Sep 26, 2014 at 12:48 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>>> promise = createPersistentNotification(...);
>>> promise.then(notificationWasShown, notificationWasRejected);
>>
>> Well presumably we still want to share an object of sorts as part of
>> the event, so all the notification data is exposed somehow. A promise
>> does not make much sense to me as a service worker can be killed at
>> any point.
>
> I'm not sure I understand what you are saying here. The above code is
> the creation steps, not the notification steps.

Oh, but shown implies it's displayed, which currently can happen
later. But as per the other thread maybe we should get rid of that.
Assuming we get rid of that, this seems to help a bit with error
handling, but is otherwise mostly identical in approach to just
keeping the constructor.


> I agree that the "click" event needs to expose the Notification
> object. But the SW "click" event needs to be fired at the SW global,
> and have as one of its properties the Notification object. Exactly
> because the SW might have been killed previously and is just getting
> spawned in order to fire the "click" event. Thus no other references
> to the Notification object might exist.

Sure.


-- 
https://annevankesteren.nl/

Received on Friday, 26 September 2014 13:40:41 UTC