Intent to Implement and Ship: Notification "silent" attribute

49 views
Skip to first unread message

Peter Beverloo

unread,
Feb 26, 2015, 5:31:41 PM2/26/15
to blink-dev
Contact emails

Spec

"A notification has an associated silent preference flag which is initially unset. When set indicates that no sound should be made."

Summary
The "silent" flag as part of Notification options, which allows authors to indicate that no sound, vibrations or visual indicators (light indicator) should be made when the notification is being shown. For example:

serviceWorkerRegistration.showNotification('Title', {
    body: 'This is not important',
    silent: true
});

Compatibility Risk
Low, but we are the first to implement this. The flag, once set, is not exposed to Web developers anymore.

Ongoing technical constraints
None. The following two patches contain the implementation:


Will this feature be supported on all five Blink platforms (Windows, Mac, Linux, Chrome OS and Android)?
Yes, but only the Android implementation makes noise right now.

In the future, when we start supporting the "sound" and/or "vibrate" options of notifications, these will of course respect the "silent" flag on all platforms.

OWP launch tracking bug?
None. This is a very trivial addition.

Requesting approval to ship?
Yes.

Chris Harrelson

unread,
Feb 26, 2015, 9:55:59 PM2/26/15
to Peter Beverloo, blink-dev
LGTM

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

Elliott Sprehn

unread,
Feb 26, 2015, 10:00:28 PM2/26/15
to Peter Beverloo, blink-dev
This feature seems good, but it's kind of weird that the preference flags for a notification don't seem to be exposed on the object as readonly properties (or maybe I missed it?).

Philip Jägenstedt

unread,
Feb 27, 2015, 4:42:54 AM2/27/15
to Elliott Sprehn, Peter Beverloo, blink-dev
LGTM2, but I agree with Elliott that it's odd to not expose the setting on the the Notification interface.

Also, do native platforms allow you to control audio, vibration and light separate? If they do, should the notification API not have separate settings?

Philip

Peter Beverloo

unread,
Feb 27, 2015, 6:30:02 AM2/27/15
to Philip Jägenstedt, Elliott Sprehn, blink-dev
That's good feedback, thank you Elliott and Philip. I have filed an issue against the Notification specification:

Native platforms do allow you to control them manually. The Notification specification also allows "sound" and "vibrate" options, but we don't support them yet. The "silent" option is about allowing developers to suppress default behavior until we do give them full control.

Thanks,
Peter

Peter Beverloo

unread,
Mar 2, 2015, 1:52:06 PM3/2/15
to Philip Jägenstedt, Chris Harrelson, Elliott Sprehn, blink-dev
The specification has been updated, so this now is an attribute as well.

I've updated the implementation patches and added a layout test in the third of the series.

Chris, does your LGTM carry forward per this change?

Thanks,
Peter

Chris Harrelson

unread,
Mar 2, 2015, 1:57:28 PM3/2/15
to Peter Beverloo, Philip Jägenstedt, Elliott Sprehn, blink-dev
Still LGTM. :)

Dimitri Glazkov

unread,
Mar 3, 2015, 10:41:22 AM3/3/15
to Chris Harrelson, Peter Beverloo, Philip Jägenstedt, Elliott Sprehn, blink-dev
LGTM3.

:DG<
Reply all
Reply to author
Forward
0 new messages