Created
March 28, 2012 18:53
-
-
Save enriclluelles/2229404 to your computer and use it in GitHub Desktop.
Amiando hammering script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //This needs to be run when you're on the amiando euruko page, because of the same origin policy on iframes | |
| setTimeout(function rl(){ | |
| function aux() { | |
| document.body.innerHTML= ''; | |
| document.write("<iframe id='i' src='http://www.amiando.com/euruko2012.html' style='width: 100%;height: 100%'></iframe>"); | |
| setTimeout(rl, 1000); | |
| } | |
| console.log('reloading'); | |
| var iframe = document.getElementById("i"); | |
| if (!iframe) { | |
| aux(); | |
| } | |
| var iframeDocument = iframe.contentWindow.document; | |
| console.log(iframe); | |
| var select = iframeDocument.getElementsByTagName('select')[1]; | |
| if (!select) { | |
| aux(); | |
| } else { | |
| console.log(select); | |
| select.options[1].selected = 'selected'; | |
| var evt = iframeDocument.createEvent("MouseEvents"); | |
| evt.initMouseEvent("click", true, true, window, | |
| 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
| var button = iframeDocument.getElementById("wizardNextButton"); | |
| button.dispatchEvent(evt); | |
| }; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hahaha, genius! :)