From 0bf680da4ba9f2759d42ff1ac5584b258ffe3221 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Sat, 11 Jun 2016 11:40:27 +0200 Subject: [PATCH] Fix the "URL popup" not appearing when using `zf` --- extension/lib/utils.coffee | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/extension/lib/utils.coffee b/extension/lib/utils.coffee index f18224f..c3b7642 100644 --- a/extension/lib/utils.coffee +++ b/extension/lib/utils.coffee @@ -316,12 +316,18 @@ simulateMouseEvents = (element, sequence) -> screenX: window.screenX + rect.left screenY: window.screenY + rect.top }) - # The last `true` below marks the event as trusted, which some APIs require, - # such as `requestFullscreen()`. (`element.dispatchEvent(mouseEvent)` is not - # able to do this.) - window.QueryInterface(Ci.nsIInterfaceRequestor) - .getInterface(Ci.nsIDOMWindowUtils) - .dispatchDOMEventViaPresShell(element, mouseEvent, true) + if type == 'mousemove' + # If the below technique is used for this event, the “URL popup” (shown + # when hovering or focusing links) does not appear. + element.dispatchEvent(mouseEvent) + else + # The last `true` below marks the event as trusted, which some APIs + # require, such as `requestFullscreen()`. + # (`element.dispatchEvent(mouseEvent)` is not able to do this.) + window + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils) + .dispatchDOMEventViaPresShell(element, mouseEvent, true) return -- 2.39.3