Notifications On Chrome Are Not Clickable
Closed this issue · 3 comments
llk23r commented
I guess it's more of a feature-request than an issue: When notifications are URLs, it should be possible to view the link on the browser by clicking on the notification. As of now, this is not possible.
perskes commented
Currently reading into this:
I think this is a limitation by the Web Push API, and not notify.run, so until this feature is added to the underlying API, notify.run will probably not support it.
paulgb commented
Thanks for the suggestion @llk23r and for looking into it @perskes.
I think it's possible if we:
- Before constructing the message json, parse out a URL if one exists and add it to the message JSON object with a new field called
action
. - In the service worker, add a notificationclick handler that opens it.
A couple design decisions I've been thinking about:
- Rather than parsing the URL from the text, maybe it makes more sense to add an
action
argument to notify.send? This way you don't have to clutter up the notification text with a URL. - If so, the question is what the server API should look like when you hit the POST endpoint for a channel. The current behavior is to use the whole POST request as the message, which makes the
curl
command simple. Instead, we could try parsing the message asmultipart/form-data
and fall back on treating it as text for backwards compatibility.
I'll have a go at this when I get a chance.
paulgb commented
As of notify-run 0.0.11, you can now pass a URL to notify-run to open when a notification is clicked. See the readme for details.