summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKris Maglione <maglione.k@gmail.com>2011-02-06 17:34:34 -0500
committerKris Maglione <maglione.k@gmail.com>2011-02-06 17:34:34 -0500
commit83738de1639c5018c5017b2373b81e96bb86dfeb (patch)
treef48be2e37e048ab9bf753fdb60b53ee7fe5fb2fb
parent4211f6ee072b94b80e24cbcbd888b82dc858ed29 (diff)
parent00dccddc876f1722042c835a07aeffe8b36b17b5 (diff)
downloadpentadactyl-83738de1639c5018c5017b2373b81e96bb86dfeb.tar.gz
Merge default.
--HG-- branch : groups
-rwxr-xr-xcommon/bootstrap.js12
-rw-r--r--common/content/disable-acr.jsm (renamed from pentadactyl/content/disable-acr.jsm)13
-rw-r--r--common/modules/overlay.jsm8
3 files changed, 17 insertions, 16 deletions
diff --git a/common/bootstrap.js b/common/bootstrap.js
index 4ab93a0f..837a2f39 100755
--- a/common/bootstrap.js
+++ b/common/bootstrap.js
@@ -169,9 +169,11 @@ function init() {
}
try {
- module("resource://dactyl-local-content/disable-acr.jsm").init();
+ module("resource://dactyl-content/disable-acr.jsm").init(addon.id);
+ }
+ catch (e) {
+ reportError(e);
}
- catch (e) {}
if (JSMLoader && JSMLoader.bump != 3) // Temporary hack
Services.scriptloader.loadSubScript("resource://dactyl" + suffix + "/bootstrap.jsm",
@@ -197,9 +199,11 @@ function shutdown(data, reason) {
dump("dactyl: bootstrap: shutdown " + reasonToString(reason) + "\n");
if (reason != APP_SHUTDOWN) {
try {
- module("resource://dactyl-local-content/disable-acr.jsm").cleanup();
+ module("resource://dactyl-content/disable-acr.jsm").cleanup();
+ }
+ catch (e) {
+ reportError(e);
}
- catch (e) {}
if ([ADDON_UPGRADE, ADDON_DOWNGRADE, ADDON_UNINSTALL].indexOf(reason) >= 0)
Services.obs.notifyObservers(null, "dactyl-purge", null);
diff --git a/pentadactyl/content/disable-acr.jsm b/common/content/disable-acr.jsm
index f5ebe74b..de231635 100644
--- a/pentadactyl/content/disable-acr.jsm
+++ b/common/content/disable-acr.jsm
@@ -1,7 +1,7 @@
// By Kris Maglione. Public Domain.
// Please feel free to copy and use at will.
-const ADDON_ID = "pentadactyl@dactyl.googlecode.com";
+var ADDON_ID;
const OVERLAY_URLS = [
"about:addons",
@@ -18,12 +18,15 @@ function observe(window, topic, url) {
if (topic === "chrome-document-global-created")
checkDocument(window.document);
}
-function init(disable) {
- Services.obs[disable ? "removeObserver" : "addObserver"](observe, "chrome-document-global-created", false);
+function init(id) {
+ if (id)
+ ADDON_ID = id;
+
+ Services.obs[id ? "addObserver" : "removeObserver"](observe, "chrome-document-global-created", false);
for (let doc in chromeDocuments)
- checkDocument(doc, disable);
+ checkDocument(doc, !id);
}
-function cleanup() { init(true); }
+function cleanup() { init(null); }
function checkPopup(event) {
let doc = event.originalTarget.ownerDocument;
diff --git a/common/modules/overlay.jsm b/common/modules/overlay.jsm
index 8a4ce14f..1106ad2c 100644
--- a/common/modules/overlay.jsm
+++ b/common/modules/overlay.jsm
@@ -250,13 +250,7 @@ var Overlay = Module("Overlay", {
defineModule.loadLog.push(" from: " + util.fixURI(frame.filename) + ":" + frame.lineNumber);
let obj = defineModule.time(module.className, "init", module);
- try {
- delete modules[module.className];
- modules[module.className] = obj;
- }
- catch (e) {
- Class.replaceProperty(modules, module.className, obj);
- }
+ Class.replaceProperty(modules, module.className, obj);
loaded[module.className] = true;
frob(module.className);