[whatwg] Notifications: reviving Notification objects

Mounir Lamouri mounir at lamouri.fr
Thu Apr 4 04:53:13 PDT 2013


On 31/03/13 15:33, Anne van Kesteren 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.

I guess a better example would be that the website is unloaded on memory
pressure but the tab is kept. Otherwise, an explicit user action could
be considered as enough to remove all currently opened notifications.

> 1) Tie "the document's address" of when a Notification is created to
> the Notification object to address B) and C). Maybe at some point
> allow sites to define a URL to open.

What if I have to instance of the same website open? what if those two
instances have different contexts like not logged in with the same user?

> 2) Define a method on Navigator, getNotifications(), that returns a
> Future which is resolved with an array of Notification objects. Once
> the Future is resolved, a task is queued to fire a click event on the
> appropriate Notification object in case of B) and C).

This magic behaviour with the click event is a bit weird. Does that mean
that the UA shouldn't do anything with the notification? What if the
website never calls getNotifications()? We could expect the UA to close
the notification by default when the website is re-opened but if it has
to wait for a possible .getNotifications() call, what should be done?
Timing out seems a bit racy.

--
Mounir


More information about the whatwg mailing list