Skip to content

Instantly share code, notes, and snippets.

@meain
Last active June 9, 2017 17:15
Show Gist options
  • Save meain/dc36b6dd6e4ce873535aed460c40878a to your computer and use it in GitHub Desktop.
Save meain/dc36b6dd6e4ce873535aed460c40878a to your computer and use it in GitHub Desktop.
Whatsapp web spam script
// for send function to select input
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);
}
// enters input and clicks button
function send(msg){
a=document.getElementsByClassName('input')[1];
dispatch(a,"textInput",msg);
document.getElementsByClassName('icon-send')[0].click();
}
var myVar = setInterval(myTimer, 5000); //5 second interval
function myTimer() {
send("Weee!");
}
@vbajs
Copy link

vbajs commented Oct 29, 2016

It dosent work, It depends on the user on what does he type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment