Tuesday, 27 August 2013

Redirecting A Specific Tab Firefox Add On

Redirecting A Specific Tab Firefox Add On

I'm writing an exntension for firefox. Basically by using
getElementsByClassName, I'm searching for a specific class and if there's
any hit, I'm redirecting the page by using: gBrowser.loadURI The problem
is if I open a link by middle mouse button, that link is opened in the
background tab. So if there's any hit for the above class criteria in that
page, the active tab is redirected instead of the bacground one, which is
a wrong behaviour. So basically I want to use a similar loadURI function
but for a specific tab, not the current active tab. Instead of loadURI I
can also use window.location = "http://www.google.com/". But somehow when
I use window.location, every button in the ff window disappears, as if
full view. Do you have any idea for redirecting the inactive tab?

No comments:

Post a Comment