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

Fix clickable elements with class 'btn' #4566

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions content_scripts/link_hints.js
Original file line number Diff line number Diff line change
Expand Up @@ -1204,11 +1204,11 @@ const LocalHints = {
// # Detect elements with "click" listeners installed with `addEventListener()`.
// isClickable ||= element.hasAttribute "_vimium-has-onclick-listener"

// An element with a class name containing the text "button" might be clickable. However, real
// An element with a class name containing the text "button" or "btn" 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.
const className = element.getAttribute("class");
if (!isClickable && className?.toLowerCase().includes("button")) {
if (!isClickable && (className?.toLowerCase().includes("button") || className?.toLowerCase().includes("btn"))) {
isClickable = true;
possibleFalsePositive = true;
}
Expand Down