mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-22 09:25:45 +01:00
Work around stupid fucking crash on FF3.6. Closes issue \#127.
Update issue \#124 This is not fixed on Firefox <4.0, given that the correct fix causes crashes. --HG-- extra : rebase_source : 1cade319b1260cb1dc20330a338ce34104ffddff
This commit is contained in:
@@ -645,7 +645,8 @@ const Buffer = Module("buffer", {
|
||||
|
||||
prefs.withContext(function () {
|
||||
prefs.set("browser.tabs.loadInBackground", true);
|
||||
["mousedown", "mouseup"].forEach(function (event) {
|
||||
["mousedown", "mouseup", "click"].slice(0, util.haveGecko("2.0") ? 2 : 3)
|
||||
.forEach(function (event) {
|
||||
events.dispatch(elem, events.create(doc, event, {
|
||||
screenX: offsetX, screenY: offsetY,
|
||||
ctrlKey: ctrlKey, shiftKey: shiftKey, metaKey: ctrlKey
|
||||
|
||||
@@ -364,11 +364,13 @@ const Events = Module("events", {
|
||||
* @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);
|
||||
},
|
||||
dispatch: Class.memoize(function ()
|
||||
util.haveGecko("2.0")
|
||||
? function (target, event) // This causes a crash on Gecko<2.0, it seems.
|
||||
target.ownerDocument.defaultView
|
||||
.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIDOMWindowUtils)
|
||||
.dispatchDOMEventViaPresShell(target, event, true)
|
||||
: function (target, event) target.dispatchEvent(event)),
|
||||
|
||||
/**
|
||||
* Converts an event string into an array of pseudo-event objects.
|
||||
|
||||
Reference in New Issue
Block a user