On Sep 8, 5:53 am, wpollans <wpoll...@gmail .comwrote:
Hello,
I need to able to write JS that will click on a link with the middle
mouse button - so that the link target will open in a new window or
tab - using firefox. Or is there a better (more reliable) way to have
the link open in a new window/tab (using JS)? I have no control over
the JS already on the page - this is for a selenium user extension
that I'd like to write.
You can try using dispatchEvent:
<URL:
http://groups.google.com.au/group/co...cea9cdf065a524
>
But it probably won't do what you expect, clicking the scroll wheel is
not the equivalent of a middle mouse button click[1]. In Firefox, a
scroll wheel click on a link opens the link in a new tab if
preferences are set to do that, the link itself never receives the
click.
In Safari, a click is sent to the link but you can only send a middle
button click, which is different to a scroll wheel click, and the link
is opened in a new window.
1. You may be able to change preferences for your mouse keys to make a
scroll wheel click the same as a middle mouse button click, but that
can't be relied upon.
--
Rob