I'm surprised that no browser has done the obvious yet: treat middle-clicking a DOM element with a bound onclick handler the same as left-clicking that DOM element, but override window.open and window.location.redirect within the context of that handler call to open links in a new tab instead.
I have an extension in Firefox which changes the mouse cursor for (1) from pointer (hand), so I can easily distinguish that case, I hope this became a W3C standard somehow (though the standard way for executing JS are buttons, not anchors, so probably it won't ever become standardized).