Search code examples
javascriptautomationgoogle-chrome-extensiongreasemonkeyuserscripts

Web Automation running in background


I'm looking to automate a set of actions on a website. A Sample set of actions would be the following...

1. Click on an element (hyperlink)
2. Wait 6000ms
3. Click on a different element (hyperlink)
4. Wait 60000ms
5. Repeat

I know many things that can accomplish this task such as iMacro, JAVA's robot class, Selenium, etc.), but all of those programs run in the foreground. I was wondering if there is anyway to implement this while still retaining mouse control ie. the program would run in the background. How can this be accomplished?


Solution

  • You can use web workers and normal JavaScript to do this. Just start a Worker on a script and call dispatchEvent with a click event on the hyperlinks in question.