mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 07:45:45 +01:00
Dispatch events from buffer.followLink as trusted events. Closes issue #124.
This commit is contained in:
@@ -289,7 +289,7 @@ const Events = Module("events", {
|
||||
let duringFeed = this.duringFeed;
|
||||
this.duringFeed = [];
|
||||
for (let [, evt] in Iterator(duringFeed))
|
||||
evt.target.dispatchEvent(evt);
|
||||
events.dispatch(evt.target, evt);
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -358,6 +358,18 @@ const Events = Module("events", {
|
||||
return events.fromString(keys).map(events.closure.toString).join("");
|
||||
},
|
||||
|
||||
/**
|
||||
* Dispatches an event to an element as if it were a native event.
|
||||
*
|
||||
* @param {Node} target The DOM node to which to dispatch the event.
|
||||
* @param {Event} event The event to dispatch.
|
||||
*/
|
||||
dispatch: function (target, event) {
|
||||
return target.ownerDocument.defaultView
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
|
||||
.dispatchDOMEventViaPresShell(target, event, true);
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts an event string into an array of pseudo-event objects.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user