Firefox extension: gBrowser not defined

This is a Firefox extension, and everything works very well.

BUT ... I keep getting the annoying "gBrowser is not defined" error in the console because of this line:

gBrowser.selectedTab = gBrowser.addTab("chrome://ire_TPB/content/options.html"); 

I try, of course, to open a new tab and load this local html page.

What am I doing wrong?

Thanks!

Win 7 ult
Ff 7.0

+6
source share
1 answer

From the Mozilla Documentation : "If gBrowser is not defined, your code either does not work in the browser area or works too early. You can access gBrowser only after the browser window has fully loaded."

+9
source

Source: https://habr.com/ru/post/899913/


All Articles