Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include elements with pointer cursor style as clickable links. #3063

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CREDITS
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@ Contributors:
Darryl Pogue <darryl@dpogue.ca> (github: dpogue)
tobimensch
Ramiro Araujo <rama.araujo@gmail.com> (github: ramiroaraujo)
Tyler Elliott (github: tylercal)

Feel free to add real names in addition to GitHub usernames.
10 changes: 10 additions & 0 deletions content_scripts/link_hints.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,16 @@ LocalHints =
# # Detect elements with "click" listeners installed with `addEventListener()`.
# isClickable ||= element.hasAttribute "_vimium-has-onclick-listener"

# in the meantime, use the more expensive computedStyleMap to see if elements have a "cursor: pointer" style
# NOTE: because we are optimizing by checking the className attribute of the element, we will miss elements
# that get their pointer style from combinators and tag styles, e.g. li > span, .menu > div
isClickable ||= element.style.cursor == "pointer" or
element.className != "" and
element.computedStyleMap().get("cursor").value == "pointer" and
element.parentElement.computedStyleMap().get("cursor").value != "pointer"



# 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.
Expand Down