Are you sure the script is actually testing the gameplay? Given it can see the entire source code of the game.

It started out using browser.click events and then switched to using browser.evaluate script injection. That's entirely valid for my use case.