Browse Source

Code styling

pull/2/head
Deathamns 10 years ago
committed by gorhill
parent
commit
ff7c9e96ae
  1. 30
      platform/firefox/bootstrap.js

30
platform/firefox/bootstrap.js

@ -26,13 +26,8 @@
/******************************************************************************/ /******************************************************************************/
let bgProcess;
/******************************************************************************/
function startup(data, reason) {
bgProcess = function(e) {
if (e) {
let bgProcess = function(e) {
if ( e ) {
this.removeEventListener('DOMContentLoaded', bgProcess); this.removeEventListener('DOMContentLoaded', bgProcess);
} }
@ -44,9 +39,16 @@ function startup(data, reason) {
hDoc.createElementNS('http://www.w3.org/1999/xhtml', 'iframe') hDoc.createElementNS('http://www.w3.org/1999/xhtml', 'iframe')
); );
bgProcess.setAttribute('src', 'chrome://ublock/content/background.html'); bgProcess.setAttribute('src', 'chrome://ublock/content/background.html');
};
};
/******************************************************************************/
function startup(data, reason) {
if ( reason !== APP_STARTUP ) {
bgProcess();
return;
}
if (reason === APP_STARTUP) {
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);
@ -56,18 +58,16 @@ function startup(data, reason) {
win.addEventListener('DOMContentLoaded', bgProcess); win.addEventListener('DOMContentLoaded', bgProcess);
} }
}); });
}
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);
} }
/******************************************************************************/ /******************************************************************************/

Loading…
Cancel
Save