Code styling

pull/2/head
Deathamns 10 years ago committed by gorhill
parent 37a9f4d762
commit ff7c9e96ae

@ -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);
}
@ -44,9 +39,16 @@ function startup(data, reason) {
hDoc.createElementNS('http://www.w3.org/1999/xhtml', 'iframe')
);
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']
.getService(Components.interfaces.nsIWindowWatcher);
@ -56,18 +58,16 @@ function startup(data, reason) {
win.addEventListener('DOMContentLoaded', bgProcess);
}
});
}
else {
bgProcess();
}
}
/******************************************************************************/
function shutdown(data, reason) {
if (reason !== APP_SHUTDOWN) {
bgProcess.parentNode.removeChild(bgProcess);
if ( reason === APP_SHUTDOWN ) {
return;
}
bgProcess.parentNode.removeChild(bgProcess);
}
/******************************************************************************/

Loading…
Cancel
Save