1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-18 12:25:46 +01:00

Fix flashblock plugin event magic.

This commit is contained in:
Kris Maglione
2011-03-02 02:50:21 -05:00
parent 8621e7f79f
commit 28d1c1bcad

View File

@@ -301,7 +301,7 @@ var EventHive = Class("EventHive", Contexts.Hive, {
* @param {boolean} capture When true, listen during the capture * @param {boolean} capture When true, listen during the capture
* phase, otherwise during the bubbling phase. * phase, otherwise during the bubbling phase.
*/ */
listen: function (target, event, callback, capture) { listen: function (target, event, callback, capture, allowUntrusted) {
if (isObject(event)) if (isObject(event))
var [self, events] = [event, event[callback || "events"]]; var [self, events] = [event, event[callback || "events"]];
else else
@@ -311,7 +311,8 @@ var EventHive = Class("EventHive", Contexts.Hive, {
let args = [Cu.getWeakReference(target), let args = [Cu.getWeakReference(target),
event, event,
this.wrapListener(callback, self), this.wrapListener(callback, self),
capture]; capture,
allowUntrusted];
target.addEventListener.apply(target, args.slice(1)); target.addEventListener.apply(target, args.slice(1));
this.sessionListeners.push(args); this.sessionListeners.push(args);
@@ -331,7 +332,7 @@ var EventHive = Class("EventHive", Contexts.Hive, {
this.sessionListeners = this.sessionListeners.filter(function (args) { this.sessionListeners = this.sessionListeners.filter(function (args) {
if (target == null || args[0].get() == target && args[1] == event && args[2] == callback && args[3] == capture) { if (target == null || args[0].get() == target && args[1] == event && args[2] == callback && args[3] == capture) {
args[0].get().removeEventListener.apply(args[0].get(), args.slice(1)); args[0].get().removeEventListener.apply(args[0].get(), args.slice(1));
return true; return false;
} }
return !args[0].get(); return !args[0].get();
}); });