Hi
What I want to do is trigger a function from an extension/GM Script once a page in FireFox reloads/refreshes...
Picture this:
- I goto a webpage that asks for a username and password.
- My code populates these values and submits the credentials
- The webpage reloads and brings up a page asking me to enter a pre-decided number
- I enter the number
- The webpage reloads and brings up a page asking me to select an option from a dropdown
- I select ... .. you get the idea..
I figured I wanted to write some JavaScript to do all this.. and since persistence would be required and I don't have capability to change the source site, I thought of writing a FireFox extension or GreaseMonkey - basically anything on the client side.
Something like that the event DOMContentReloaded would have acted like (had it existed) :
addEventListener("DOMContentReloaded", pageReloaded, false);
Typical test cases for such code would be to:
- Find out how much time it took between page refreshes
- Wait for the second instance of page refresh to happen and then redirect to another page ,etc ..
All this would be done from a FireFox extension (or GreaseMonkey in case a slution in GM would be easier/better/recommended) - given this, things should be easy?