Intent to Ship: Notification image

61 views
Skip to first unread message

John Mellor

unread,
Oct 5, 2016, 5:57:04 PM10/5/16
to blink-dev

Contact emails

joh...@chromium.org


Spec

https://notifications.spec.whatwg.org/#image-resource


There was recently a TAG review for the overall notifications spec (before |image| was added). The feedback from that is mostly unrelated to images/icons, except for the suggestion to allow specifying multiple image sizes for icons, which is being discussed in issue 28. The plan there is to define image/icon inputs as a typedef (USVString or sequence<NotificationIcon>), so this change is forward-compatible with that.


Summary

Allows developers to show a large image as part of the content of a notification (whereas the existing |icon| and |badge| properties tend to be icons and are rendered smaller). This allows for richer notifications.


Link to “Intent to Implement” blink-dev discussion

https://groups.google.com/a/chromium.org/d/topic/blink-dev/FQxPB5GEQjo/discussion


Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?

Yes, except Mac and WebView:
- It will work briefly on Mac, but stop being supported if/when we switch to the system notification center which does not support large content images.
- It will not initially be supported on WebView because notifications are not yet supported there.

Demo link

https://tests.peter.sh/notification-generator/#image=1 (set the "Image" field)


Debuggability

As usual, the image property is reflected on the Notification object. Support can be feature-detected using Notification.prototype.hasOwnProperty('image');


Interoperability and Compatibility Risk

Firefox: Public support, though didn't get an explicit reply from implementers
Edge: No public signals (mentioned privately, but they're heads-down on shipping SW+push+notifications, so haven't currently got much time for spec work in this area)
Safari: No public signals (Apple implement an older version of the spec that predates Service Workers etc, and don't comment on new features)
Web developers: Strongly positive (explicitly requested by 5+ large partners)

Android, Windows 10 and Chrome OS all natively support showing a large image as part of the notification content (exact rendering varies, for example some platforms only show it when the notification is expanded, and some platforms may leave less room for text when an image is shown). macOS and iOS do not yet seem to support such images (they only support smaller icons).

There is no risk of breaking existing content. There is a small risk that we might want to change details later due to platform inconsistencies, but the spec is deliberately vague about if/how the image will be shown (since UAs are often constrained by the platform's notification capabilities), so we have a fair amount of leeway here.

OWP launch tracking bug

None yet. https://crbug.com/614456 tracks implementation.


Entry on the feature dashboard

https://www.chromestatus.com/features/5190797599178752


Philip Jägenstedt

unread,
Oct 6, 2016, 7:21:50 AM10/6/16
to John Mellor, blink-dev
LGTM1

(If anyone can't find #image-resource, try a manual refresh, the caching is too aggressive it seems.)

Jochen Eisinger

unread,
Oct 6, 2016, 7:24:00 AM10/6/16
to Philip Jägenstedt, John Mellor, blink-dev
lgtm2

Please make sure that security is not concerned about the image being used to disguise as another origin.

Chris Harrelson

unread,
Oct 6, 2016, 10:57:39 AM10/6/16
to Jochen Eisinger, Philip Jägenstedt, John Mellor, blink-dev
LGTM3

--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.

Reply all
Reply to author
Forward
0 new messages