From f2d7e185c704e3cf8f6ca0c9d3d4da2498610475 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 14 Dec 2017 14:08:35 +0000 Subject: Detect click listeners for link hints. This is a simpler version of #1167. It detects clickable elements with listeners added with `addEventListener()`. It includes some of @mrmr1993's ideas from #1167 (in fact, it's mostly those ideas tweaked into a slightly different form). --- content_scripts/link_hints.coffee | 3 +++ 1 file changed, 3 insertions(+) (limited to 'content_scripts/link_hints.coffee') diff --git a/content_scripts/link_hints.coffee b/content_scripts/link_hints.coffee index 0592c96d..e5c6b3ea 100644 --- a/content_scripts/link_hints.coffee +++ b/content_scripts/link_hints.coffee @@ -706,6 +706,9 @@ LocalHints = isClickable = true reason = "Open." + # Detect elements with "click" listeners installed with `addEventListener()`. + isClickable ||= element.hasAttribute vimiumOnClickAttributeName + # An element with a class name containing the text "button" might be clickable. However, real clickables # are often wrapped in elements with such class names. So, when we find clickables based only on their # class name, we mark them as unreliable. -- cgit v1.2.3