Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to send "click middle mouse button" to link

Reply
Thread Tools

how to send "click middle mouse button" to link

 
 
wpollans
Guest
Posts: n/a
 
      09-07-2007
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.


Thanks,


Warren

 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      09-08-2007
On Sep 8, 5:53 am, wpollans <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Heres a mouse theres a mouse what a mouse do? unholy Gaming 37 09-17-2006 08:59 AM
FF won't work w/middle mouse button=Back rxp Firefox 6 05-06-2005 08:28 PM
Logitech middle mouse button for Firefox level13@gmail.com Firefox 0 04-29-2005 08:52 PM
middle mouse button in FIREFOX F_r_a_n_k__P_a_n_u_c_c_i Firefox 4 01-14-2005 04:32 PM



Advertisments