There are a number of ways this can be done and they vary in complexity and effectiveness significantly.
- You can control/drive any browser via a browser extension registered online (e.g. chrome store) and installed the usual way.
- Problem 1: extension needs to be approved and signed by the browser owners
- Problem 2: you need an extension for each browser you want to control
- Problem: Only works with Chrome
- Problem: Although very doable implementation, especially for both the two major browsers out there (Chrome and FF) is on the hard side.
- Problem. Hardest of all four to do especially because of the window focus protection defeating requirement but also because of the complications related to correctly calculating coordinates where clicks (and not keystrokes) are absolutely needed.