Skip to content

Consider removing maxActions #110

New issue

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

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

Already on GitHub? Sign in to your account

Open
hober opened this issue Oct 11, 2017 · 17 comments · May be fixed by #232
Open

Consider removing maxActions #110

hober opened this issue Oct 11, 2017 · 17 comments · May be fixed by #232

Comments

@hober
Copy link

hober commented Oct 11, 2017

ISTM exposing maxActions increases the fingerprinting surface of the platform to little benefit. It might be worth dropping, or perhaps not requiring implementations to expose it.

@beverloo
Copy link
Member

In my view, the ideal number of buttons is platform (and OS version) specific as it largely depends on their presentation. Influencers include whether or not button icons are visible, horizontal or vertical stacking and/or whether they're in a drop-down menu that may hide other functionality.

Based on the sort of cross-platform inconsistency problems that developers run in to for notifications, I would personally prefer providing more information rather than less. Maybe even carefully erring towards some sort of getCapabilitiesAndImageResolutions() call. Is there a particular fingerprinting association that you're worried about that couldn't be derived from the user agent?

@annevk
Copy link
Member

annevk commented Feb 27, 2018

The other problem with this feature, and actions in general, is that it seems there's only one implementation.

@beverloo
Copy link
Member

I would love to learn why other vendors haven't implemented support for actions. We're seeing that >5% of desktop and >10% of mobile notifications includes at least one.

@saschanaz
Copy link
Member

I'm implementing actions in Firefox and I find it impractical to retrieve the actual max number of actions via a synchronous attribute, on top of the fingerprinting concern mentioned here.

Chrome returns 2 everywhere, Firefox will most probably do the same. Maybe the spec can also just define it as constant.

@annevk
Copy link
Member

annevk commented Feb 28, 2025

You don't think not exposing it at all is an option? With only one implementation we could just remove it.

@saschanaz
Copy link
Member

We'll have some limitation for the number of actions, wouldn't it be confusing to silently show only the first few actions without exposing actual max number?

@annevk
Copy link
Member

annevk commented Feb 28, 2025

I'm not really sure how to reconcile that statement with the idea that the specification can just define it as a constant. If it's always going to return 2, people will know they can have two actions (and maybe more). They don't need that attribute for that.

@saschanaz
Copy link
Member

saschanaz commented Feb 28, 2025

Ah okay, if we go that route, I'd also vote to throw for extra actions rather than simply ignore as the current spec says:

For each entry in options["actions"], up to the maximum number of actions supported (skip any excess entries):

If it'll be 2 everywhere then we don't really get anything by silently ignoring, it only becomes a footgun.

Edit: But the current validation steps for other fields also just ignore invalid values...

@saschanaz saschanaz linked a pull request Mar 4, 2025 that will close this issue
5 tasks
@annevk
Copy link
Member

annevk commented Mar 11, 2025

An alternative that might work is that it returns 2 until permission is granted, at which point it can return the accurate number.

@saschanaz
Copy link
Member

Mozilla would be fine with that approach, although we still need to add an async function to get the accurate number.

@saschanaz
Copy link
Member

Just to note: Currently platforms do not provide an API for browsers to query about the max action count. It's all hardcoded: Android says 3, Windows says 5, and macOS says 10, and not even sure whether it's documented at all for Gnome/KDE/other Linux desktop environments. And all of these may be different based on their versions.

@annevk
Copy link
Member

annevk commented Mar 18, 2025

I'm not sure why we'd need an async function.

@saschanaz
Copy link
Member

To query the system about the limit?

@annevk
Copy link
Member

annevk commented Mar 18, 2025

Why wouldn't you just run the maxActions getter again once the permission state changes?

@saschanaz
Copy link
Member

You mean you want to make Notification.permission pass the maxActions too? 🤔

@annevk
Copy link
Member

annevk commented Mar 18, 2025

I'm not sure what you mean. The user agent can update things as part of there being permission. One such thing can be the internal slot for maxActions.

@saschanaz
Copy link
Member

But the sole purpose of that would be just to return it through Notification.maxActions, not sure that's more practical than having Notification.getMaxActions that does it on-demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants