|
@ -26,12 +26,7 @@ |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
let bgProcess; |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
function startup(data, reason) { |
|
|
|
|
|
bgProcess = function(e) { |
|
|
|
|
|
|
|
|
let bgProcess = function(e) { |
|
|
if ( e ) { |
|
|
if ( e ) { |
|
|
this.removeEventListener('DOMContentLoaded', bgProcess); |
|
|
this.removeEventListener('DOMContentLoaded', bgProcess); |
|
|
} |
|
|
} |
|
@ -46,7 +41,14 @@ function startup(data, reason) { |
|
|
bgProcess.setAttribute('src', 'chrome://ublock/content/background.html'); |
|
|
bgProcess.setAttribute('src', 'chrome://ublock/content/background.html'); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
if (reason === APP_STARTUP) { |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
|
|
|
function startup(data, reason) { |
|
|
|
|
|
if ( reason !== APP_STARTUP ) { |
|
|
|
|
|
bgProcess(); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let ww = Components.classes['@mozilla.org/embedcomp/window-watcher;1'] |
|
|
let ww = Components.classes['@mozilla.org/embedcomp/window-watcher;1'] |
|
|
.getService(Components.interfaces.nsIWindowWatcher); |
|
|
.getService(Components.interfaces.nsIWindowWatcher); |
|
|
|
|
|
|
|
@ -57,17 +59,15 @@ function startup(data, reason) { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
else { |
|
|
|
|
|
bgProcess(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|
|
|
|
|
|
|
function shutdown(data, reason) { |
|
|
function shutdown(data, reason) { |
|
|
if (reason !== APP_SHUTDOWN) { |
|
|
|
|
|
bgProcess.parentNode.removeChild(bgProcess); |
|
|
|
|
|
|
|
|
if ( reason === APP_SHUTDOWN ) { |
|
|
|
|
|
return; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bgProcess.parentNode.removeChild(bgProcess); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/******************************************************************************/ |
|
|
/******************************************************************************/ |
|
|