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
|
* Initialize some variables and prepare event listeners for when chrome is done loading
|
||||||
*/
|
*/
|
||||||
function init() {
|
function init() {
|
||||||
try {
|
if (!Zotero || !Zotero.initialized || !window.hasOwnProperty("gBrowser")) {
|
||||||
var gb = gBrowser;
|
|
||||||
} catch(e) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!Zotero || !Zotero.initialized || !gb) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Zotero_Browser.browserData = new Object();
|
|
||||||
|
|
||||||
window.addEventListener("load",
|
window.addEventListener("load",
|
||||||
function(e) { Zotero_Browser.chromeLoad(e) }, false);
|
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() {
|
function chromeUnload() {
|
||||||
delete Zotero_Browser.browserData;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue