1
0
Fork 0
mirror of https://github.com/gorhill/uMatrix.git synced 2024-07-05 22:41:04 +12:00

Code styling

This commit is contained in:
Deathamns 2014-12-28 21:26:06 +01:00 committed by gorhill
parent 37a9f4d762
commit ff7c9e96ae

View file

@ -26,12 +26,7 @@
/******************************************************************************/ /******************************************************************************/
let bgProcess; let bgProcess = function(e) {
/******************************************************************************/
function startup(data, reason) {
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) { if ( reason === APP_SHUTDOWN ) {
bgProcess.parentNode.removeChild(bgProcess); return;
} }
bgProcess.parentNode.removeChild(bgProcess);
} }
/******************************************************************************/ /******************************************************************************/