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

Add Autoclick Behavior #83

Merged
merged 7 commits into from
Jan 15, 2025
Merged

Add Autoclick Behavior #83

merged 7 commits into from
Jan 15, 2025

Conversation

ikreymer
Copy link
Member

@ikreymer ikreymer commented Dec 13, 2024

Fixes #81
Adds new autoclick behavior, which:

  • Attempts to click on all 'a' elements as the default selector, customizable via opts.clickSelector option.
  • Click on all links that are different page on same domain to trigger custom event handlers, requery all links in case DOM is changed due to dynamic navigation / custom event handler.
  • Use heuristics to determine when link may just be a simple navigation (check event click handlers, check if target is set, check if element is visible, etc...)
  • Use onbeforeunload to attempt to block navigation if link navigates away
  • support custom selectors via

- support all 'a' links
- store seen elements, not just links to avoid duplicate clicks
@ikreymer ikreymer marked this pull request as ready for review January 15, 2025 01:56
- use 'a' not 'a[href]' as default
- add checkVisibility() check
- bump typescript version
@ikreymer ikreymer requested a review from tw4l January 15, 2025 20:23
Copy link
Member

@tw4l tw4l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good and has been working well in testing, just one question

@ikreymer ikreymer merged commit 43b967d into main Jan 15, 2025
5 of 7 checks passed
@ikreymer ikreymer deleted the autoclick branch January 15, 2025 23:45
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.

Autoclick Behavior
2 participants