Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Always limit the maximum number of actions to 2 #232

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions notifications.bs
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,13 @@ support these features might ignore them.
<dd>Null or a resource. It is initially null.
</dl>

<p>Users may activate actions, as alternatives to activating the notification itself. The
<dfn>maximum number of actions</dfn> supported is an <a>implementation-defined</a> integer of zero
or more, within the constraints of the notification platform.
<p>Users may activate actions, as alternatives to activating the notification itself.

<p class=note>Since display of actions is platform-dependent, developers are encouraged to make sure
that any action an end user can invoke from a notification is also available within the web
<p class=note>The maximum number of supported actions are limited to 2 on all platforms, to prevent
fingerprinting based on the actual maximum number of the underlying system.

<p class=note>Since the support of actions is platform-dependent, developers are encouraged to make
sure that any action an end user can invoke from a notification is also available within the web
application.

<p class="note no-backref">Some platforms might modify an
Expand Down Expand Up @@ -258,8 +259,10 @@ important information through, e.g., loss of color or clipped corners.
<li><p>Set <var>notification</var>'s <a for=notification>actions</a> to « ».

<li>
<p>For each <var>entry</var> in <var>options</var>["{{NotificationOptions/actions}}"], up to the
<a>maximum number of actions</a> supported (skip any excess entries):
<p>Let |actions| be a [=list=] of initial maximum two items from
Copy link
Member Author

@saschanaz saschanaz Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my best effort to make a sublist without actual corresponding infra term. Filed whatwg/infra#666.

I wonder we should throw instead for excess items, though.

|options|["{{NotificationOptions/actions}}"].

<p>[=list/For each=] |entry| of |actions|:

<ol>
<li><p>Let <var>action</var> be a new <a for=/>notification action</a>.
Expand Down Expand Up @@ -632,8 +635,6 @@ interface Notification : EventTarget {
static readonly attribute NotificationPermission permission;
[Exposed=Window] static Promise&lt;NotificationPermission> requestPermission(optional NotificationPermissionCallback deprecatedCallback);

static readonly attribute unsigned long maxActions;

attribute EventHandler onclick;
attribute EventHandler onshow;
attribute EventHandler onerror;
Expand Down Expand Up @@ -809,9 +810,6 @@ method steps are:
makes sense. Specifications for other APIs should not use this pattern and instead employ one of the
<a href="http://robert.ocallahan.org/2011/06/permissions-for-web-applications_30.html">many more suitable alternatives</a>.

<p>The static <dfn attribute for=Notification><code>maxActions</code></dfn> getter steps are to
return the <a>maximum number of actions</a> supported.

<h3 id=object-members>Object members</h3>

<p>The following are the <a>event handlers</a> (and their corresponding
Expand Down
Loading