Re: [whatwg] Notifications: reviving Notification objects

On Sun, Mar 31, 2013 at 10:33 AM, Anne van Kesteren <annevk@annevk.nl> wrote:
> There are a couple of scenarios http://notifications.spec.whatwg.org/
> does not address at the moment.
>
> A) User navigates to chat site. Chat site creates a notification from
> a chat with P while the user does something else. User closes chat
> site and then navigates to chat site at a later point.
>
> B) Instead of navigating to the chat site at a later point, the user
> opens the notification center and clicks the notification.
>
> C) User navigates to chat site at a later point, but with a view that
> does not show the chat with P. User then opens the notification center
> and clicks the notification.

B and C both require some deeper architectural changes. Some kind of
event page/worker that can be notified as we've been discussing. Once
that is in place we can address those use cases.

A requires being able to get the notifications associated with a
certain site. That can also be useful in case multiple windows are
open of the same site and can help workers and pages coordinate once
we enable notifications in workers.

The idea to address A is:

  Notification.get({tag})

which returns a Promise which is fulfilled with an array of
Notification objects for which tag is tag or all Notification objects
if no tag is defined. The objects are origin-scoped. The reason a
promise is used is because getting notifications may be a
cross-process operation.


--
http://annevankesteren.nl/

Received on Tuesday, 9 July 2013 15:33:09 UTC