diff options
Diffstat (limited to 'lib/FrameModule.jsm')
-rw-r--r-- | lib/FrameModule.jsm | 74 |
1 files changed, 36 insertions, 38 deletions
diff --git a/lib/FrameModule.jsm b/lib/FrameModule.jsm index 543013c..7af0e63 100644 --- a/lib/FrameModule.jsm +++ b/lib/FrameModule.jsm @@ -2,7 +2,7 @@ ηMatrix - a browser extension to black/white list requests. Copyright (C) 2014-2019 The µBlock authors - Copyright (C) 2019-2020 Alessio Vanni + Copyright (C) 2019-2022 Alessio Vanni This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see {http://www.gnu.org/licenses/}. - Home: https://libregit.spks.xyz/heckyel/ematrix + Home: https://gitlab.com/vannilla/ematrix uMatrix Home: https://github.com/gorhill/uMatrix */ @@ -68,10 +68,8 @@ var contentObserver = { cpMessageName: hostName + ':shouldLoad', uniqueSandboxId: 1, modernFirefox: - (Services.appinfo.ID === '{ec8030f7-c20a-464f-9b0e-13a3a9e97384}' - || Services.appinfo.ID === '{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}' - || Services.appinfo.ID === '{9184b6fe-4a5c-484d-8b4b-efbfccbfb514}') - && Services.vc.compare(Services.appinfo.version, '44') > 0, + ((Services.appinfo.ID === '{9184b6fe-4a5c-484d-8b4b-efbfccbfb514}') + && Services.vc.compare(Services.appinfo.version, '44') > 0), get componentRegistrar() { return Components.manager.QueryInterface(Ci.nsIComponentRegistrar); @@ -79,14 +77,14 @@ var contentObserver = { get categoryManager() { return Components.classes['@mozilla.org/categorymanager;1'] - .getService(Ci.nsICategoryManager); + .getService(Ci.nsICategoryManager); }, QueryInterface: XPCOMUtils.generateQI([ - Ci.nsIFactory, - Ci.nsIObserver, - Ci.nsIContentPolicy, - Ci.nsISupportsWeakReference + Ci.nsIFactory, + Ci.nsIObserver, + Ci.nsIContentPolicy, + Ci.nsISupportsWeakReference ]), createInstance: function (outer, iid) { @@ -102,16 +100,16 @@ var contentObserver = { if (!this.modernFirefox) { this.componentRegistrar - .registerFactory(this.classID, - this.classDescription, - this.contractID, - this); + .registerFactory(this.classID, + this.classDescription, + this.contractID, + this); this.categoryManager - .addCategoryEntry('content-policy', - this.contractID, - this.contractID, - false, - true); + .addCategoryEntry('content-policy', + this.contractID, + this.contractID, + false, + true); } }, @@ -120,12 +118,12 @@ var contentObserver = { if (!this.modernFirefox) { this.componentRegistrar - .unregisterFactory(this.classID, - this); + .unregisterFactory(this.classID, + this); this.categoryManager - .deleteCategoryEntry('content-policy', - this.contractID, - false); + .deleteCategoryEntry('content-policy', + this.contractID, + false); } }, @@ -222,17 +220,17 @@ var contentObserver = { }; messager.addMessageListener(sandbox._sandboxId_, - sandbox._messageListener_); + sandbox._messageListener_); messager.addMessageListener(hostName + ':broadcast', - sandbox._messageListener_); + sandbox._messageListener_); }; sandbox.removeMessageListener = function () { try { messager.removeMessageListener(sandbox._sandboxId_, - sandbox._messageListener_); + sandbox._messageListener_); messager.removeMessageListener(hostName + ':broadcast', - sandbox._messageListener_); + sandbox._messageListener_); } catch (ex) { // It throws sometimes, mostly when the popup closes } @@ -262,8 +260,8 @@ var contentObserver = { } if (loc.protocol !== 'http:' - && loc.protocol !== 'https:' - && loc.protocol !== 'file:') { + && loc.protocol !== 'https:' + && loc.protocol !== 'file:') { if (loc.protocol === 'chrome:' && loc.host === hostName) { this.initContentScripts(win); } @@ -294,9 +292,9 @@ var contentObserver = { doc.addEventListener('DOMContentLoaded', docReady, true); } else { docReady({ - target: doc, - type: 'DOMContentLoaded', - }); + target: doc, + type: 'DOMContentLoaded', + }); } } }; @@ -326,13 +324,13 @@ LocationChangeListener.prototype.QueryInterface = XPCOMUtils.generateQI([ LocationChangeListener.prototype.onLocationChange = function (webProgress, request, location, flags) { - if (!webProgress.isTopLevel) { + if (!webProgress.isTopLevel) { return; - } - this.messageManager.sendAsyncMessage(locationChangedMessageName, { + } + this.messageManager.sendAsyncMessage(locationChangedMessageName, { url: location.asciiSpec, flags: flags, - }); + }); }; contentObserver.register(); |