I have some graphs created with the Javascript library Protovis. Underneath this works by rendering out a bunch of SVG stuff.
One of the things I need to support is clicking on the graph to open a page with the details of the datapoint that was clicked on.
Currently I’m doing this by registering for “click” events in Protovis then detecting if it was a left or middle mouse button and dispatching with window.location.href = datalink; or window.open(datalink); respectively.
All of which works beautifully… in Chrome or Safari.
In Firefox the middle mouse button doesn’t raise a click event.
Is there some extra something I need to capture middle click events in Firefox? or is it just not possible?
Is there some way I could get open in new tab into the right click menu?
P.S. Firefox extensions aren’t a good solution, I can’t really force an extension on all my users.
Try “onmousedown” instead of “onclick”.