www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit e37dc98ef9d7a90ba4021e7cd79ba8ccf8a73ca7
parent f834e3f63e26813eee80c9593c8192a75d23915c
Author: Simon Kornblith <simon@simonster.com>
Date:   Wed,  2 Mar 2011 02:08:05 +0000

check whether gBrowser exists during init() without actually accessing it


Diffstat:
Mchrome/content/zotero/browser.js | 12++----------
1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/chrome/content/zotero/browser.js b/chrome/content/zotero/browser.js @@ -104,17 +104,10 @@ 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) { - return; - } - if (!Zotero || !Zotero.initialized || !gb) { + if (!Zotero || !Zotero.initialized || !window.hasOwnProperty("gBrowser")) { return; } - Zotero_Browser.browserData = new Object(); - window.addEventListener("load", function(e) { Zotero_Browser.chromeLoad(e) }, false); window.addEventListener("unload", @@ -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; } /*