Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firefox extension: gBrowser is not defined

This is a Firefox extension and everything is working pretty good.

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

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

What I am trying to do of course is open a new tab and load that local html page.

What am I doing wrong?

Thanks!

Win 7 ult
FF 7.0

like image 286
Ryan Avatar asked Oct 23 '11 16:10

Ryan


1 Answers

From Mozilla Documentation: "If gBrowser isn't defined your code is either not running in the scope of the browser window or running too early. You can access gBrowser only after the browser window is fully loaded."

like image 155
tr4656 Avatar answered Sep 21 '22 10:09

tr4656