1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-14 16:25:48 +01:00

Manually add list of global object properties to global objects.

--HG--
extra : rebase_source : 53318cbfe4a044e6bbf9facb1ce6bc5933ba6fd9
This commit is contained in:
Kris Maglione
2010-09-25 12:28:55 -04:00
parent 8f34359ab8
commit 0956c9a83b
5 changed files with 30 additions and 10 deletions

View File

@@ -734,8 +734,9 @@ function Module(name, prototype) {
defineModule.modules.push(instance);
return module;
}
if (Cu.getGlobalForObject)
Module.callerGlobal = function (caller) {
Class.objectGlobal = function (caller) {
try {
return Cu.getGlobalForObject(caller);
}
@@ -744,7 +745,7 @@ if (Cu.getGlobalForObject)
}
};
else
Module.callerGlobal = function (caller) {
Class.objectGlobal = function (caller) {
while (caller.__parent__)
caller = caller.__parent__;
return caller;

View File

@@ -103,7 +103,7 @@ const Sanitizer = Module("sanitizer", tmp.Sanitizer, {
function (key, event, arg) {
if (event == name)
params.action.apply(params, arg);
}, Module.callerGlobal(params.action));
}, Class.objectGlobal(params.action));
if (params.privateEnter || params.privateLeave)
storage.addObserver("private-mode",
@@ -111,7 +111,7 @@ const Sanitizer = Module("sanitizer", tmp.Sanitizer, {
let meth = params[arg ? "privateEnter" : "privateLeave"];
if (meth)
meth.call(params);
}, Module.callerGlobal(params.action));
}, Class.objectGlobal(params.action));
},
observe: {