Created
May 13, 2016 19:21
-
-
Save maury91/749fb66006dc36b11a3c828a9454e803 to your computer and use it in GitHub Desktop.
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
//Paste this script on the console | |
//Config var, change this var at runtime to change the message | |
var autoMessage = prompt('Message to send'); | |
//Support var | |
var isActive = false; | |
//Check every 200ms if the status of the textarea is changed | |
setInterval(function() { | |
var isActiveNow = !document.querySelector('textarea.chatmsg').disabled; | |
//If the textarea was previously disabled and now is enabled, means that we are meeting a new stranger | |
//And obviously check if we have a message to send | |
if ( !isActive && isActiveNow && autoMessage ) { | |
//Write the message | |
document.querySelector('textarea.chatmsg').value = autoMessage; | |
//Send the message after 500ms | |
setTimeout(function() { | |
document.querySelector('button.sendbtn').click(); | |
},500); | |
} | |
//Update textarea status always | |
isActive = isActiveNow; | |
},200); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment