From 50189a450fb238a57c77778559d12ee607e8a22d Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 26 Sep 2015 11:08:50 -0400 Subject: [PATCH] this fixes https://github.com/gorhill/uBlock/issues/640 --- platform/firefox/bootstrap.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/platform/firefox/bootstrap.js b/platform/firefox/bootstrap.js index 6704d54..6a5d1ee 100644 --- a/platform/firefox/bootstrap.js +++ b/platform/firefox/bootstrap.js @@ -19,7 +19,7 @@ Home: https://github.com/gorhill/uMatrix */ -/* global ADDON_UNINSTALL, APP_SHUTDOWN, APP_STARTUP */ +/* global ADDON_UNINSTALL, APP_SHUTDOWN */ /* exported startup, shutdown, install, uninstall */ 'use strict'; @@ -46,7 +46,7 @@ const restartListener = { /******************************************************************************/ -function startup(data, reason) { +function startup(data/*, reason*/) { if ( data !== undefined ) { version = data.version; } @@ -84,7 +84,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; } @@ -99,7 +105,7 @@ function startup(data, reason) { } try { - appShell.hiddenDOMWindow; + void appShell.hiddenDOMWindow; } catch (ex) { return; }