Intent to Ship: Notification.data and SWR.getNotifications()

48 views
Skip to first unread message

Peter Beverloo

unread,
Apr 21, 2015, 7:02:22 AM4/21/15
to blink-dev, Sanghyun Park
Contact emails

Spec

Summary
Notification.data allows developers to associate some data with a Notification, e.g. an id or a small object with state. The data will be surfaced in events and when using getNotifications(), and is strictly tied to the lifetime of the notification itself.

ServiceWorkerRegistration.getNotifications() allows developers to get an array with the persistent notifications currently showing for the given Service Worker registration. It supports filtering previous notifications by their tag.

Link to “Intent to Implement” blink-dev discussion

Is this feature supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
Yes - minus Android WebView because we don’t support Notifications there.

Compatibility Risk
Small, although we are the first browser to ship these.

In order to mitigate abuse of using Notification.data for storing large amounts of data, a UA imposed limit of 1MB has been implemented in Chromium. A histogram tracking the size of the developer-provided data is in place.

When the developer exceeds this limit, the showNotification() promise will be rejected. The limit may be adjusted in future releases based on the histogram. We can pursue standardization of this limit based on the results as well.

OWP launch tracking bug?
None.

Link to entry on the feature dashboard

Philip Jägenstedt

unread,
Apr 21, 2015, 11:42:08 AM4/21/15
to Peter Beverloo, blink-dev, Sanghyun Park
LGTM. The plan for dealing with the size restriction sounds good.

Chris Harrelson

unread,
Apr 21, 2015, 4:12:42 PM4/21/15
to Peter Beverloo, blink-dev, Sanghyun Park
LGTM2.

To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.

TAMURA, Kent

unread,
Apr 21, 2015, 6:39:03 PM4/21/15
to Chris Harrelson, Peter Beverloo, blink-dev, Sanghyun Park
LGTM3.

--
TAMURA Kent
Software Engineer, Google


Reply all
Reply to author
Forward
0 new messages