From a6c579b2b1dfbce8938439be3a0ab3e64cac3226 Mon Sep 17 00:00:00 2001 From: Alan Wu Date: Sun, 12 Jun 2016 04:27:17 -0400 Subject: [PATCH] Fix `zF` double clicking on browser elements (#757) `nsIDOMWindowUtils.dispatchDOMEventViaPresShell()` dispatches a 'command' event automatically after a 'click' event on XUL pages. This was causing `zF` to effectively double click on browser elements, since VimFx also simulates a 'command' event. Elements which suffers from this double click include but are not limited to, the new tab button, question mark circles in the preferences page and buttons created by the add-on sdk. --- extension/lib/utils.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/extension/lib/utils.coffee b/extension/lib/utils.coffee index c3b7642..94bcfd7 100644 --- a/extension/lib/utils.coffee +++ b/extension/lib/utils.coffee @@ -46,9 +46,10 @@ XULMenuListElement = Ci.nsIDOMXULMenuListElement XULTextBoxElement = Ci.nsIDOMXULTextBoxElement # Full chains of events for different mouse actions. Note: 'click' is fired -# by Firefox automatically after 'mousedown' and 'mouseup'. +# by Firefox automatically after 'mousedown' and 'mouseup'. Similarly, +# 'command' is fired automatically after 'click' on xul pages. EVENTS_CLICK = ['mousedown', 'mouseup'] -EVENTS_CLICK_XUL = ['click', 'command'] +EVENTS_CLICK_XUL = ['click'] EVENTS_HOVER_START = ['mouseover', 'mouseenter', 'mousemove'] EVENTS_HOVER_END = ['mouseout', 'mouseleave'] -- 2.39.3