diff options
author | Alessio Vanni <vannilla@firemail.cc> | 2020-10-01 20:49:31 +0200 |
---|---|---|
committer | Jesús <heckyel@hyperbola.info> | 2022-04-06 09:32:11 +0800 |
commit | adf5b9165c0712d1bcb834e03582d22837facce9 (patch) | |
tree | b31a809bf9875e02e423e4e50cb6aab559aa25f9 | |
parent | 0d26dd3e2e9bee7f1fccda83c82507a90eb59c64 (diff) | |
download | ematrix-adf5b9165c0712d1bcb834e03582d22837facce9.tar.lz ematrix-adf5b9165c0712d1bcb834e03582d22837facce9.tar.xz ematrix-adf5b9165c0712d1bcb834e03582d22837facce9.zip |
Hardcode the hostname in boostrap.js
The variable was likely used by uMatrix because the code was shared
with uBlock, but this is not the case for ηMatrix, so let's just use
the string as-is.
Signed-off-by: Jesús <heckyel@hyperbola.info>
-rw-r--r-- | bootstrap.js | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/bootstrap.js b/bootstrap.js index 0bceb56..0127d89 100644 --- a/bootstrap.js +++ b/bootstrap.js @@ -32,7 +32,6 @@ let windowlessBrowser = null; let windowlessBrowserPL = null; let bgProcess = null; let version; -const hostName = 'ematrix'; const restartListener = { get messageManager() { @@ -71,15 +70,14 @@ function createBgProcess(parentDocument) { 'iframe')); bgProcess.setAttribute('src', - 'chrome://' + hostName - + '/content/background.html#' + version); - + 'chrome://ematrix/content/background.html#' + + version); // https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIMessageListenerManager#addMessageListener%28%29 // "If the same listener registers twice for the same message, the // "second registration is ignored." restartListener .messageManager - .addMessageListener(hostName + '-restart', restartListener); + .addMessageListener('ematrix-restart', restartListener); } function getWindowlessBrowserFrame(appShell) { @@ -113,9 +111,7 @@ function getWindowlessBrowserFrame(appShell) { Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT); windowlessBrowser.document.location = - "data:application/vnd.mozilla.xul+xml;charset=utf-8,<window%20id='" - + hostName - + "-win'/>"; + "data:application/vnd.mozilla.xul+xml;charset=utf-8,<window%20id='ematrix-win'/>"; } function waitForHiddenWindow() { @@ -224,8 +220,7 @@ function shutdown(data, reason) { // Remove the restartObserver only when the extension is being disabled restartListener .messageManager - .removeMessageListener(hostName + '-restart', - restartListener); + .removeMessageListener('ematrix-restart', restartListener); } function install(data, reason) { @@ -251,6 +246,6 @@ function uninstall(data, aReason) { // To cleanup vAPI.localStorage in vapi-common.js, aka // "extensions.ematrix.*" in `about:config`. Cu.import('resource://gre/modules/Services.jsm', null) - .Services.prefs.getBranch('extensions.' + hostName + '.') + .Services.prefs.getBranch('extensions.ematrix') .deleteBranch(''); } |