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. The default middle click action of “Open new tab” is not formally documented.
It is believe that for interoperability and legacy purposes the best approach is to fire the click event only for the primary button and that is reflected in the current UI Events Spec. However some applications may wish to override the default behavior of the UA. Specifically it is desirable to have an event for the middle button and explicitly define the default behavior.
Introduce a MouseEvent of type “auxclick” (other suggestions are welcome) which is fired for all non-primary buttons. This event is not only dispatched for middle button but also covers click for other buttons. It should be targeted at the node (i.e. common ancestor of mousedown and mouseup targets) and bubble as the click event does.
Click events are special in terms of allowing untrusted default action behavior for legacy purposes. It is believe that untrusted auxclick events should be are treated purely as untrusted and must not run the default action behavior.
Since we are changing the type from click to auxclick but keeping all other semantics the same, we believe only minor changes to applications that are currently using this behavior would be required.
Some of the use cases were mentioned briefly in the problem specification. But beyond listening to the auxclick event and capability to prevent opening a new tab or recording the metrics for opening the links in the new tab, this new event enables developers to also do actions on click for other buttons and expands the number of ways developers can expect the actions of their users.