1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 20:44:11 +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
* phase, otherwise during the bubbling phase.
*/
listen: function (target, event, callback, capture) {
listen: function (target, event, callback, capture, allowUntrusted) {
if (isObject(event))
var [self, events] = [event, event[callback || "events"]];
else
@@ -311,7 +311,8 @@ var EventHive = Class("EventHive", Contexts.Hive, {
let args = [Cu.getWeakReference(target),
event,
this.wrapListener(callback, self),
capture];
capture,
allowUntrusted];
target.addEventListener.apply(target, args.slice(1));
this.sessionListeners.push(args);
@@ -331,7 +332,7 @@ var EventHive = Class("EventHive", Contexts.Hive, {
this.sessionListeners = this.sessionListeners.filter(function (args) {
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));
return true;
return false;
}
return !args[0].get();
});