-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow "notificationclick" to focus/open windows #30
Comments
Chrome is going to implement a timeframe of 10 seconds. |
Shouldn't the HTML specification be modified for this? "Allowed to show a popup" is based on stack inspection. |
Do you mean that tapping on a notification should count as "Allowed to show a popup"? That means tapping a notification would be able to show a file dialog, make an element full screen etc. Is that desirable? |
Probably? I'm not sure. Someone would have to ask UX. |
I don't think that tapping a notification should count towards showing a file dialog or making an element full screen. |
Yeah true, although none of that would be possible anyway from a service worker. So... @jakearchibald, you want an equivalent definition of "allowed to show a popup" it sounds like, but wouldn't it be better if that was part of the service worker specification? |
Just to clarify, are you suggesting:
Given that https://html.spec.whatwg.org/#allowed-to-show-a-popup lists |
I don't understand |
For the sack of being abstract enough, I would call this user interaction and say that notificationclick event represents a user interaction. There might be other events representing a user interaction. |
I don't think this is a serviceworker-only issue. The way I see it:
Tapping a notification is not serviceworker specific. You can do this from a page by creating a notification and listening for its |
Thinking about this more. "allowed to show a popup" should only apply to the current global, so you can't get a If clicking a notification shouldn't be able to make elements fullscreen, open a file dialog etc, then we need something other than "allowed to show a popup". |
Following on from w3c/ServiceWorker#602 (comment),
notificationclick
handlers should be able to focus/open windows via theclients
API in the ServiceWorker.A typical pattern would be:
Since
.matchAll
is async, does the spec need to take this into account to allow focusing/opening of windows?https://html.spec.whatwg.org/#allowed-to-show-a-popup mentions a user-agent defined timeframe of ~4 seconds.
The text was updated successfully, but these errors were encountered: