From 6c65672db0814d6202f7e4c20dba75f77e2426ff Mon Sep 17 00:00:00 2001 From: gorhill Date: Fri, 25 Sep 2015 12:26:56 -0400 Subject: [PATCH] this fixes #640 --- platform/firefox/bootstrap.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/platform/firefox/bootstrap.js b/platform/firefox/bootstrap.js index d1adfc47b..c765d989d 100644 --- a/platform/firefox/bootstrap.js +++ b/platform/firefox/bootstrap.js @@ -19,7 +19,7 @@ Home: https://github.com/gorhill/uBlock */ -/* global ADDON_UNINSTALL, APP_SHUTDOWN, APP_STARTUP */ +/* global ADDON_UNINSTALL, APP_SHUTDOWN */ /* exported startup, shutdown, install, uninstall */ 'use strict'; @@ -48,7 +48,7 @@ const restartListener = { /******************************************************************************/ -function startup(data, reason) { +function startup(data/*, reason*/) { if ( data !== undefined ) { version = data.version; } @@ -86,7 +86,13 @@ function startup(data, reason) { ); }; - if ( reason !== APP_STARTUP ) { + var ready = false; + try { + ready = appShell.hiddenDOMWindow && + appShell.hiddenDOMWindow.document; + } catch (ex) { + } + if ( ready ) { onReady(); return; }