Contact emails
nzol...@chromium.org
Spec
https://navidz.github.io/auxclick/
Summary
The new input event type "auxclick" 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 according to the spec https://w3c.github.io/uievents/#event-type-click. So after this change "click" event will no longer be dispatched for non-primary buttons.
Previous Intents:
Intent to Implement: auxclick
Intent to remove: Non-primary button click event
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?
Yes
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
From: Navid Zolghadr [mailto:nzol...@chromium.org]
> Right now there are two sets of developers concerning this issue. One that forgot to check the button value for click event and they mistakenly do whatever they do (like opening a link in the current page) for middle click as well. You can see they have expressed their opinions here in this bug: https://crbug.com/255 and it seems they are a lot more than the second group. The other set is using click event for middle button legitimately and do some stuff with it. Like closing a tab in Chrome devtools or gathering some metrics when user middle click on a link like the history page in Chrome. Changing the url of the link on mousedown or generating synthetic click event for middle button by listening to mousedown/up are both having some blind spots which will cause some problems for this second group to easily use auxclick event instead of click event.
This phrasing helps me understand that my concern is somewhat separable from the auxclick feature as a whole. In particular, auxclick seems likely to have good use cases: you point out closing a tab in Chrome devtools, and I could imagine this being useful for web authors as well writing similar tabbed UIs. I wish we had web developers expressing these needs that you could cite, instead of "No signals", because right now the use cases you've given can be solved with a privileged API that is not exposed to the web. But it makes sense that web developers at large would benefit from this.
In contrast, my concern is about the specific user gesture of middle clicking on a link. As in my earlier message, I think this is similar to Alt+F4ing a window, or Escing from fullscreen, and should not be cancelable. So I guess my concern would be addressed simply by making auxclick uncancelable when clicking on a link. This would allow auxclick to be used for cases like closing a tab or performing a specific action in a web-based game, but would prevent the overriding of user intent that I am concerned about.
I'm not sure we should be designing around specific browser affordances. We are very careful, in general, to avoid standardising UI. If the browser creates an uncancelable behavior, that's up to the browser. I'm not sure it needs any API change; as a result I'm inclined to support auxclick as-is.
Regards
From: Navid Zolghadr [mailto:nzol...@chromium.org]
> Right now there are two sets of developers concerning this issue. One that forgot to check the button value for click event and they mistakenly do whatever they do (like opening a link in the current page) for middle click as well. You can see they have expressed their opinions here in this bug: https://crbug.com/255 and it seems they are a lot more than the second group. The other set is using click event for middle button legitimately and do some stuff with it. Like closing a tab in Chrome devtools or gathering some metrics when user middle click on a link like the history page in Chrome. Changing the url of the link on mousedown or generating synthetic click event for middle button by listening to mousedown/up are both having some blind spots which will cause some problems for this second group to easily use auxclick event instead of click event.
This phrasing helps me understand that my concern is somewhat separable from the auxclick feature as a whole. In particular, auxclick seems likely to have good use cases: you point out closing a tab in Chrome devtools, and I could imagine this being useful for web authors as well writing similar tabbed UIs. I wish we had web developers expressing these needs that you could cite, instead of "No signals", because right now the use cases you've given can be solved with a privileged API that is not exposed to the web. But it makes sense that web developers at large would benefit from this.
In contrast, my concern is about the specific user gesture of middle clicking on a link. As in my earlier message, I think this is similar to Alt+F4ing a window, or Escing from fullscreen, and should not be cancelable. So I guess my concern would be addressed simply by making auxclick uncancelable when clicking on a link. This would allow auxclick to be used for cases like closing a tab or performing a specific action in a web-based game, but would prevent the overriding of user intent that I am concerned about.
What do you think?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
For example, it is semi-common practice to use `return false` to stop propagation, not realizing that it also cancels the event
But do developers really do "return false" to try to "stop propagation"? AFAIK "return false" has only ever canceled the event (without stopping it's propagation).
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
On Fri, Aug 26, 2016 at 1:40 PM, Domenic Denicola <d...@domenic.me> wrote:From: Rick Byers [mailto:rby...@chromium.org]
> I don't think there's value in worrying about sites who are intentionally trying to cause annoying/hostile UX here. If the site really doesn't want you to open the link in the new window then they can much more easily do that by using a link with an empty href and doing whatever it is they want in response to raw mouseup/keyboard events. Or (if there are really reasons to try to make the link appear legitimate) as PhistucK said, temporarily clearing the href in the mouseup handler. Right? What specifically are you worried about developers doing that would justify the need for uncancellable events or a privileged API?
I am worried more about poorly-coded sites than malicious ones. For example, it is semi-common practice to use `return false` to stop propagation, not realizing that it also cancels the event. Or sites like the aforementioned game which don't realize that they have an "About" link in their footer or help menu, so they preventDefault() all auxclicks as a matter of policy.Ok, thanks - that helps. But do developers really do "return false" to try to "stop propagation"? AFAIK "return false" has only ever canceled the event (without stopping it's propagation).If "auxclick" really only fires in middle-click scenarios, it's going to be exceedingly rare that a developer bothers to listen to it or even knows about the event in the first place. Maybe over time there's some risk they just start directing auxclick to their click listener but I have trouble imagining why they'd do that unless they really wanted to handle it differently somehow.If we expect auxclick to be rare, and "return false" to be a problem, then perhaps we shouldn't define any "onauxclick" properties (since this isn't an issue when using addEventListener)?If there's still a problem with developers accidentally canceling events they shouldn't then don't we have a bigger issue? Either they need the default action (in which case their UX will just be broken when it's canceled - eg. links don't navigate at all), or they don't (in which case NOT cancelling will result in double-handling - eg. opening the link in a new windows AND navigating the original page). I'm not at all convinced that making the event uncancelable in some situations would be likely to result in a better overall user experience.
Regarding the developer support in case them filing a bug counts towards that I found this one when I was trying to remove click event in my first try a few months back https://crbug.com/611972 which they asked for an alternative for middle button click. Particularly they did want to preventDefault behavior on that alternative way as well.
Regarding the poorly-written websites and "on |event|" handlers, I will gladly remove "onauxclick" from the current implementation. However, that would remove the way developer can do the feature detection for this event. Although they can always add "click" and "auxclick" listeners and do the handling in both but IMHO that doesn’t seem the best approach and keeping the "onauxclick" as is would be better. As for the malicious websites, there are already quite a lot of ways to make a link (or link-like text) not open a new tab I don’t think making it easy (or at least as easy as it was before with "click" event) would hurt the user experience. However, it does help the developers who want to write a clean code and legitimately use the preventDefault behavior of "auxclick". Domenic, does this address your concerns?
On Fri, Aug 26, 2016 at 1:43 PM, Alex Russell <sligh...@google.com> wrote:I'm not sure we should be designing around specific browser affordances. We are very careful, in general, to avoid standardising UI. If the browser creates an uncancelable behavior, that's up to the browser. I'm not sure it needs any API change; as a result I'm inclined to support auxclick as-is.Thanks Alex!
Regards
From: Navid Zolghadr [mailto:nzol...@chromium.org]
> Right now there are two sets of developers concerning this issue. One that forgot to check the button value for click event and they mistakenly do whatever they do (like opening a link in the current page) for middle click as well. You can see they have expressed their opinions here in this bug: https://crbug.com/255 and it seems they are a lot more than the second group. The other set is using click event for middle button legitimately and do some stuff with it. Like closing a tab in Chrome devtools or gathering some metrics when user middle click on a link like the history page in Chrome. Changing the url of the link on mousedown or generating synthetic click event for middle button by listening to mousedown/up are both having some blind spots which will cause some problems for this second group to easily use auxclick event instead of click event.
This phrasing helps me understand that my concern is somewhat separable from the auxclick feature as a whole. In particular, auxclick seems likely to have good use cases: you point out closing a tab in Chrome devtools, and I could imagine this being useful for web authors as well writing similar tabbed UIs. I wish we had web developers expressing these needs that you could cite, instead of "No signals", because right now the use cases you've given can be solved with a privileged API that is not exposed to the web. But it makes sense that web developers at large would benefit from this.
In contrast, my concern is about the specific user gesture of middle clicking on a link. As in my earlier message, I think this is similar to Alt+F4ing a window, or Escing from fullscreen, and should not be cancelable. So I guess my concern would be addressed simply by making auxclick uncancelable when clicking on a link. This would allow auxclick to be used for cases like closing a tab or performing a specific action in a web-based game, but would prevent the overriding of user intent that I am concerned about.
What do you think?
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
LGTM1 to ship. If we see enough abuse of middle click in the future, we could consider not allowing preventing default actions on it as an intervention.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.