Introduction
Recently, I set out to create my own Chrome extension to automate button clicks with controlled delay and repetition. As both a learning exercise and a practical tool, the aim was to build an extension that could repeatedly click any button I choose, based on CSS selectors I provide.
YouTube:
The Inspiration
The idea for building this Chrome extension originally came from my own need for an auto-click tool, but as I started researching, I stumbled upon a Reddit post from another user asking for the exact same functionality. It was encouraging to see that others had the same requirement—it confirmed the utility of this project and motivated me to share my approach and code.
Tools Used
Comet AI browser (Perplexity)
Portable Chrome (for easy extension testing)
Development Steps
Prompting Perplexity:
I need a chrome extension which auto clicks a button with delay for the number of times exactly I ask.The button (css code) will be fed manually. Give me the complete code for it.
Coding:
I received complete sample code, which included:manifest.json
popup.html
popup.js
Download it here: https://github.com/svrajadba/BrowserExtension_SimpleAutoClick
Testing:
Using Portable Chrome, I enabled Developer Mode and loaded the unpacked extension folder. This made it easy to test and refine the auto-click functionality.
Reverse generate the prompt (perplexity again) to summup all your fixup routine, such that the prompt can become a customizable request for future enhancements.
Features Implemented
Manifest V3 Chrome extension named "Simple Auto Clicker"
Inputs for:
Any CSS selector (user supplied)
Delay between clicks (in ms)
Number of repetitions
The auto-click logic is triggered via the extension popup—no automatic button detection; the user supplies the selector.
Testing and Results
To verify functionality, I opened YouTube and used the extension with:
Selector: .ytp-play-button
Delay: 5000ms
Repeat: 6
Result: The YouTube video paused and played 3 times as expected; which is 6 times click of the desired button.
Conclusion:
Developing and customizing Chrome extensions is accessible and rewarding, especially with AI-powered tools for ideation and coding support. “Simple Auto Clicker” is a great foundation for further automation and browser experimentation.
No comments:
Post a Comment