mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-01-10 13:14:11 +01:00
Merge default.
--HG-- branch : groups
This commit is contained in:
12
common/bootstrap.js
vendored
12
common/bootstrap.js
vendored
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user