W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2013

[whatwg] Notifications: in workers

From: Anne van Kesteren <annevk@annevk.nl>
Date: Sun, 31 Mar 2013 15:40:16 +0100
Message-ID: <CADnb78i5JiJ9sp1jLiNLWRRgA_7=Xvf=J=h=YfzkWOH1MtkR5A@mail.gmail.com>
To: WHATWG <whatwg@whatwg.org>
There is some interest in exposing Notification objects in a worker so
creating one does not require a postMessage() roundtrip.

This seems problematic for shared workers as it is not clear which
window the notification would be for. For normal workers this seems
like less of a concern.

If we go with the idea of exposing a URL on Notification objects and
allow that to be set we might be able to address the shared worker
issue, but it is not entirely clear to me which semantics are
desirable there.

Maybe if we made it a URL prefix it could work. E.g. you create a
notification with a URL http://example.org/mail/ If that origin is
allowed to display notifications that will all go well. If there's a
window open with that URL as prefix it can be focused once the user
activates the notification. If there's no window open a window can be
opened with that URL (no longer a prefix in this scenario). However,
if there's several windows with that URL it's not clear what the best
way would be. The last window the user interacted with maybe?

Received on Sunday, 31 March 2013 14:40:47 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:56 UTC