-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
base: master
Are you sure you want to change the base?
Fix clickable elements with class 'btn' #4566
Conversation
Fixes philc#3550 Update `content_scripts/link_hints.js` to make elements with class 'btn' clickable. * Add logic to `getLocalHintsForElement` to check for class 'btn' and mark elements as clickable. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/philc/vimium/issues/3550?shareId=XXXX-XXXX-XXXX-XXXX).
content_scripts/link_hints.js
Outdated
if (!isClickable && className?.toLowerCase().includes("btn")) { | ||
isClickable = true; | ||
possibleFalsePositive = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be part of the same if statement by doing something like:
if (!isClickable && (className?.toLowerCase().includes("button") || className?.toLowerCase().includes("btn")))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I've made a change to address this.
…redundant check for class 'button' * Merge the if statement for 'button' and 'btn' classes * Remove redundant check for class 'button'
@philc I think this PR is ready for review, let me know what you think |
Fixes #3550
Update
content_scripts/link_hints.js
to make elements with class 'btn' clickable.getLocalHintsForElement
to check for class 'btn' and mark elements as clickable.For more details, open the Copilot Workspace session.