check whether gBrowser exists during init() without actually accessing it
This commit is contained in:
parent
f834e3f63e
commit
e37dc98ef9
1 changed files with 2 additions and 10 deletions
|
@ -104,16 +104,9 @@ var Zotero_Browser = new function() {
|
|||
* Initialize some variables and prepare event listeners for when chrome is done loading
|
||||
*/
|
||||
function init() {
|
||||
try {
|
||||
var gb = gBrowser;
|
||||
} catch(e) {
|
||||
if (!Zotero || !Zotero.initialized || !window.hasOwnProperty("gBrowser")) {
|
||||
return;
|
||||
}
|
||||
if (!Zotero || !Zotero.initialized || !gb) {
|
||||
return;
|
||||
}
|
||||
|
||||
Zotero_Browser.browserData = new Object();
|
||||
|
||||
window.addEventListener("load",
|
||||
function(e) { Zotero_Browser.chromeLoad(e) }, false);
|
||||
|
@ -322,10 +315,9 @@ var Zotero_Browser = new function() {
|
|||
}
|
||||
|
||||
/*
|
||||
* When chrome unloads, delete our document objects
|
||||
* Called when chrome is unloaded
|
||||
*/
|
||||
function chromeUnload() {
|
||||
delete Zotero_Browser.browserData;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue