-
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 notifications and actions to specify a navigable URL #213
base: main
Are you sure you want to change the base?
Conversation
@saschanaz @beverloo thoughts? |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
1 or 2 minor changes are fine but getting more starts to be annoying, especially if we get multiple review rounds... 😛 Should we also fold in some part of #204 here? Non-persistent notification with a URL certainly has a valid action to do even if the page is closed. |
(Interesting that we are currently not telling what action is invoked for non-persistent notifications, per the existing steps) |
A parallel question, is WebKit going to implement actions? |
|
Some extra questions:
|
|
Having a way to bound to a tab might affect the API usage quite a bit. Needing to open a tab all the time even if the site was already open would be a bit annoying. But perhaps you've had some other types of use cases in mind. In which way do you imagine one to use only the URL + new top level navigable? |
This makes notifications more declarative by not requiring explicit handling of the clicks by the web application.
This feature is part of w3c/push-api#360 to enable fully declarative push notifications. Perhaps it should not be allowed for cc @beidson |
We should probably also consider not always opening a new tab for declarative push, btw. |
Yeah we'll think about it and are of course also happy to consider concrete proposals. I suspect that anything we decide to do can easily go on top of this, so I'm not sure I'd consider it blocking. |
Brady pointed out to me that we already reuse an existing tab if there is one. I don't think HTML has a good primitive for that, but I'll see about adjusting the wording to allow for that. Thanks for pointing it out! (I guess that raises the question as to whether there should be a feature to force a new window, but that's probably best deferred.) |
Hmmmm, in that case I would be interested to learn more about the tab selection algorithm. |
This introduces a new feature whereby push messages conforming to a certain JSON format directly create an end user notification and show it (possibly preceded by a new pushnotification event). In addition to showing a notification, the app badge can be updated as well. This builds on whatwg/notifications#213 which adds URL members to notifications. Exposing PushManager outside of service workers will be done in a separate change.
Hey Anne, this seems good to us. I've two thoughts -
Perhaps |
Also - we don't have good metrics on use between |
I think the policy we end up using in Safari is roughly reuse a tab with the same URL. There's a number of corner cases to imagine where such a vague notion could fall apart, but I'm also not sure we should try to nail it down in detail as I think we want this to be a little flexible to allow changes to it in the future and also because it fundamentally is also part of the overall end user experience. I could see renaming (Also, thanks a lot for sharing your thoughts Peter, much appreciated! And I hope all is well.) |
No strong feelings, but that (or For the internal slot, it does seem that something more specific than "URL" would be helpful for clarity. |
This makes notifications more declarative by not requiring explicit handling of the clicks by the web application.
This change is part of a larger Declarative Web Push effort, but can hopefully land in isolation as a small incremental step toward that goal.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff