Intent to Implement: auxclick

80 views
Skip to first unread message

Navid Zolghadr

unread,
Jul 7, 2016, 1:24:14 PM7/7/16
to blink-dev

Contact emails
nzol...@chromium.org


Spec
https://navidz.github.io/auxclick/


Summary
The new input event type introduced here provides web developers a way to listen to the "click" behavior of non-primary buttons, and potentially cancel their effect (eg. opening a new tab when middle clicking on a link). This new input type is needed because the click event is restricted to primary button only.

Motivation
In attempting to remove the click event for non-primary buttons in Chrome as per UI Event Spec it was discovered there is no way for the developers to prevent opening a new tab when the user middle clicks on a link.


Interoperability risk
Firefox: No public signals
Edge: No public signals
Safari: No public signals
Web developers: No signals

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

Yes

OWP launch tracking bug
https://crbug.com/625847


Link to entry on the Chrome Platform Status
https://www.chromestatus.com/features/5663174342737920

Requesting approval to ship?

No


Philip Jägenstedt

unread,
Jul 8, 2016, 7:46:15 AM7/8/16
to Navid Zolghadr, blink-dev
Example 2 in https://navidz.github.io/auxclick/ seems a bit strange. Shouldn't showing the context menu be the default action of an auxclick event rather than the other way around? And which spec should describe this interaction?

Navid Zolghadr

unread,
Jul 8, 2016, 10:38:00 AM7/8/16
to Philip Jägenstedt, blink-dev
There was this issue about the context menu and auxclick:

Contextmenu event cannot be the default action of auxclick as for example on Linux it happens right after mousedown.
Regarding the interaction if you are talking about preventDefaulting contextmenu and receiving auxclick I'd like to point out that the preventDefault is not necessary for example in FF. Basically in Chrome when contextmenu is showed it captures all the events (including the mouse up when it is showed as the result of mousedown on Linux). So it will also block page from receiving auxclick. But I can also remove that example altogether if that makes it confusing.

Philip Jägenstedt

unread,
Jul 8, 2016, 10:48:16 AM7/8/16
to Navid Zolghadr, blink-dev
Ah, the context menu does appear on mousedown on Linux, I hadn't really noticed. My next though was that preventDefault() in the mousedown event should prevent the context menu, but the whole point of the contextmenu event is I suppose that it can be canceled to achieve just that.

This then has nothing to do with the auxclick event as such. No LGTM needed, but the new event makes sense to me.
Reply all
Reply to author
Forward
0 new messages