Since the entire Notification object is exposed both on window and in
workers, I'd like some clarification on the intended behavior of
Notification.requestPermission() when called in the background.

http://notifications.spec.whatwg.org/#dom-notification-requestpermission

Some options:

    (1) Request permission in any available foreground contexts. This could
be confusing. It could also be achieved by the worker sending a message to
any foreground windows, allowing the page to provide context about the
request.

    (2) Invoke |callback| with the current permission level. This allows
developers to copy their code between windows and workers if they use the
Notification constructor within the callback when |permission| ==
"granted". This has my preference.

    (3) Ignore.

Any opinions?

Thanks,
Peter

Reply via email to