Remove Safari's support for tag
and icon
properties in the Notifications API
#24537
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Although Safari supports the
tag
andicon
properties in the Notifications API, setting them doesn't do anything.The
icon
property is supposed to allow developers to set an icon to be displayed in the system notification, replacing the default browser icon. But Safari doesn't actually display the icon.The
tag
property is supposed to allow developers to avoid displaying too many notifications in a short amount of time. When developers use the sametag
value, then new notifications replace old ones that haven't yet been displayed.Safari doesn't seem to use tags, and sending bursts of same-tag notifications does still lead to multiple notifications being displayed to the user (although not all of them, but the logic seems UA-controlled, as opposed to based on the tag).
This PR therefore marks those 2 properties as not supported by Safari, with a note.
Test results and supporting details
Test page: https://patrickbrosset.com/lab/2024-09-26-notifications-with-icon-and-tag/
Here is a screenshot showing what notifications look like on Safari, even when an icon is specified:

And the same test, in Edge:

It's harder to show screenshots for the lack of
tag
support, but this webkit bug confirms it: https://webkit.org/b/258922Especially this comment: