Need Help With Middle Click Fuction. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Need Help With Middle Click Fuction.

forrestcforrestc Posts: 1Member
I have a custom button add-on for Firefox that will go to Facebook in the currently viewing tab and would like to add middle click to open Facebook in a new tab but im not sure how. I looked around and found that I need to use the if (event.button == 4) {...} & window.open(url) but im not sure where to put them to get it to work.
Here is the current JS code.

[code]CustomButton = {

1: function () {const url = "http://www.facebook.com"


document
.getElementById("content")
.webNavigation
.loadURI(url, 0, null, null, null)
},

}[/code]

Thanks for any help and guidance.
Note: If you see anything else wrong with the code, feel free to mention it.
Sign In or Register to comment.