aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bootstrap.js17
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('');
}