Intent to Ship: Notification action buttons

72 views
Skip to first unread message

John Mellor

unread,
Oct 29, 2015, 8:38:21 AM10/29/15
to blink-dev

Contact emails

joh...@chromium.org


Spec

https://notifications.spec.whatwg.org/#actions


No tag review, as this is a small addition to an existing spec.


Summary

Support for the NotificationOptions.actions, NotificationEvent.action and Notification.maxActions attributes, which allow authors to show action buttons alongside a notification.


The Notification.actions attribute will not be shipped yet, rather like we didn't ship Notification.vibrate, since Chrome does not yet support FrozenArray. It's only a convenience attribute though, and the parts being shipped form a coherent whole without it.


We haven't yet spec'ed or implemented icons for action buttons, but those will likely be added later.


Motivation

These allow users to quickly handle the most common tasks for a particular notification, without having to open the originating website.


Link to “Intent to Implement” blink-dev discussion

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


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

All except WebView, since notifications aren't yet supported there.


Demo link

Sample code: https://notifications.spec.whatwg.org/#using-actions

Demo: https://tests.peter.sh/notification-generator/ (currently requires --enable-blink-features=NotificationExperimental before Actions can be used).


Debuggability

Breakpoints can be set in the notificationclick event as usual.


Compatibility Risk

Firefox: Public support

Internet Explorer: No public signals

Safari: No public signals

Web developers: Strongly positive


Availability and presentation of action buttons may vary across platforms (Android 4.1+, iOS 8+, Windows 10 and OS X 10.10+ natively support action buttons, but older OSes may not; Chrome is unaffected, since we render our own notifications on desktop).


Developers can feature-detect action support using the Notification.maxActions property. Additionally, the spec recommends that authors provide equivalent functionality via alternative UI.


OWP launch tracking bug

https://crbug.com/513672


Entry on the feature dashboard

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

Peter Beverloo

unread,
Oct 29, 2015, 8:43:57 AM10/29/15
to John Mellor, blink-dev

Non-OWNER lgtm

This is an important feature frequently used by native apps, and a frequently heard request from both developers and partners.

While the omission of Notification.actions is unfortunate, it won't limit developers in providing functionality because of the NotificationEvent.action attribute.

However, we need to be cautious to not end up with too many partially shipped features because of not supporting FrozenArray<>. There's a bug tracking adding support for it.

Thanks,
Peter

Rick Byers

unread,
Oct 29, 2015, 9:40:56 AM10/29/15
to Peter Beverloo, John Mellor, blink-dev
LGTM1

Has there been a tag review for notifications in general yet?  I agree we don't want to send each little addition to the TAG, they should probably have a look at the spec all together at some point.

Philip Jägenstedt

unread,
Oct 29, 2015, 6:15:23 PM10/29/15
to Rick Byers, Peter Beverloo, John Mellor, blink-dev
LGTM2

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

John Mellor

unread,
Nov 5, 2015, 12:12:23 PM11/5/15
to Rick Byers, Peter Beverloo, blink-dev
On 29 October 2015 at 13:40, Rick Byers <rby...@google.com> wrote:
LGTM1

Has there been a tag review for notifications in general yet?  I agree we don't want to send each little addition to the TAG, they should probably have a look at the spec all together at some point.

I've asked Alex Russell about this (since I wasn't sure if the TAG review WHATWG specs), and he suggested we do file a TAG review issue, but that it shouldn't block this intent to ship, so I've filed https://github.com/w3ctag/spec-reviews/issues/94.

By the way, please lgtm https://codereview.chromium.org/1412223007 once this has 3 lgtms - thanks :)

Dimitri Glazkov

unread,
Nov 5, 2015, 1:28:44 PM11/5/15
to John Mellor, Rick Byers, Peter Beverloo, blink-dev
LGTM3.
Reply all
Reply to author
Forward
0 new messages