Conversation
martinthomson
left a comment
There was a problem hiding this comment.
I'd like to see more explanatory text attached to this sort of change. (In the spec, not the PR, for avoidance of doubt.)
From what I can see, a message is opportunistically parsed as JSON. If it parses and there is a "web_push": 9001 (?!) attribute, the browser attempts to make a notification. If that works, the notification is shown.
There is also a mutable attribute attached, which would allow the SW the option of intercepting the notification and tweaking it before it is shown. That would somewhat negate the benefits from a purely declarative notification, so it seems an unnecessary feature (the app could save the "web_push": 9001 bytes and just make a notification for itself).
7b3b218 to
4f6bd92
Compare
d6af68d to
56c5432
Compare
saschanaz
left a comment
There was a problem hiding this comment.
Can we split mutable out of this PR for now?
saschanaz
left a comment
There was a problem hiding this comment.
Mostly fine with a few changes. We explicitly did not cover the app badge part of this PR though.
| </li> | ||
| <li> | ||
| <p> | ||
| Let |declarativeResult| be the result of running the [=/declarative push message |
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 an enhanced push 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 is handled by #393.
|
Force push breaks "Changes since your last review" feature 😵 |
|
Looking at WebKit/WebKit#18087, it seems WebKit shipped "pushnotification" event instead of reusing existing "push" event, deviating from this PR? 🤔 (Edit: Or WebKit changed it to "push" but the remnant of "pushnotification" is still in the source?) |
|
Thanks for finding those bugs, we'll get them fixed! |
… always start with a clean slate; hopefully the last change needed here
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 an enhanced push event).
This builds on whatwg/notifications#213 which adds URL members to notifications.
Exposing PushManager outside of service workers is #393.
The following tasks have been completed:
Implementer support:
Preview | Diff