mirror of
https://github.com/gorhill/uMatrix.git
synced 2024-07-03 13:30:31 +12:00
Code styling
This commit is contained in:
parent
37a9f4d762
commit
ff7c9e96ae
60
platform/firefox/bootstrap.js
vendored
60
platform/firefox/bootstrap.js
vendored
|
@ -26,48 +26,48 @@
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
let bgProcess;
|
let bgProcess = function(e) {
|
||||||
|
if ( e ) {
|
||||||
|
this.removeEventListener('DOMContentLoaded', bgProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
let hDoc = Components.classes['@mozilla.org/appshell/appShellService;1']
|
||||||
|
.getService(Components.interfaces.nsIAppShellService)
|
||||||
|
.hiddenDOMWindow.document;
|
||||||
|
|
||||||
|
bgProcess = hDoc.documentElement.appendChild(
|
||||||
|
hDoc.createElementNS('http://www.w3.org/1999/xhtml', 'iframe')
|
||||||
|
);
|
||||||
|
bgProcess.setAttribute('src', 'chrome://ublock/content/background.html');
|
||||||
|
};
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
function startup(data, reason) {
|
function startup(data, reason) {
|
||||||
bgProcess = function(e) {
|
if ( reason !== APP_STARTUP ) {
|
||||||
if (e) {
|
|
||||||
this.removeEventListener('DOMContentLoaded', bgProcess);
|
|
||||||
}
|
|
||||||
|
|
||||||
let hDoc = Components.classes['@mozilla.org/appshell/appShellService;1']
|
|
||||||
.getService(Components.interfaces.nsIAppShellService)
|
|
||||||
.hiddenDOMWindow.document;
|
|
||||||
|
|
||||||
bgProcess = hDoc.documentElement.appendChild(
|
|
||||||
hDoc.createElementNS('http://www.w3.org/1999/xhtml', 'iframe')
|
|
||||||
);
|
|
||||||
bgProcess.setAttribute('src', 'chrome://ublock/content/background.html');
|
|
||||||
};
|
|
||||||
|
|
||||||
if (reason === APP_STARTUP) {
|
|
||||||
let ww = Components.classes['@mozilla.org/embedcomp/window-watcher;1']
|
|
||||||
.getService(Components.interfaces.nsIWindowWatcher);
|
|
||||||
|
|
||||||
ww.registerNotification({
|
|
||||||
observe: function(win) {
|
|
||||||
ww.unregisterNotification(this);
|
|
||||||
win.addEventListener('DOMContentLoaded', bgProcess);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
bgProcess();
|
bgProcess();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let ww = Components.classes['@mozilla.org/embedcomp/window-watcher;1']
|
||||||
|
.getService(Components.interfaces.nsIWindowWatcher);
|
||||||
|
|
||||||
|
ww.registerNotification({
|
||||||
|
observe: function(win) {
|
||||||
|
ww.unregisterNotification(this);
|
||||||
|
win.addEventListener('DOMContentLoaded', 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
Loading…
Reference in a new issue