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:
@@ -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();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user