Created
May 3, 2016 12:45
-
-
Save B45i/58afc0ef8747d1cd4bd1b7c546cb4f84 to your computer and use it in GitHub Desktop.
This file contains 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
var campo = document.getElementsByClassName("input")[1]; | |
contador = 0; | |
function dispatch(target, eventType, char) { | |
var evt = document.createEvent("TextEvent"); | |
evt.initTextEvent (eventType, true, true, window, char, 0, "en-US"); | |
target.focus(); | |
target.dispatchEvent(evt); | |
} | |
function spam(){ | |
if (contador<100){ // | |
dispatch(campo, "textInput", "Hello world"); | |
var input = document.getElementsByClassName("icon btn-icon icon-send"); | |
input[0].click(); | |
contador++; | |
setTimeout(spam,1); | |
} | |
} | |
spam(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment