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

Conversation

ScottWilliamAnderson
Copy link

@ScottWilliamAnderson ScottWilliamAnderson commented Oct 29, 2024

Fixes #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.

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).
@ScottWilliamAnderson ScottWilliamAnderson marked this pull request as ready for review October 29, 2024 10:03
Comment on lines 1216 to 1219
if (!isClickable && className?.toLowerCase().includes("btn")) {
isClickable = true;
possibleFalsePositive = true;
}
Copy link
Contributor

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")))

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'
@ScottWilliamAnderson
Copy link
Author

@philc I think this PR is ready for review, let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make class="btn" clickable / Or support clickable css rule extention
2 participants