Created
March 19, 2019 15:02
-
-
Save techguybiswa/9ad99fdb666229f6eec1fcb75cd391b9 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
let textToSend = "Hey There. I wanted to wish you Happy New Year. Hope you are doing great."; | |
textToSend = textToSend.split("."); | |
let count = 0; | |
let textbox = document.querySelector('div._2S1VP'); | |
let event = new InputEvent('input', { | |
bubbles: true | |
}); | |
let messageLoop = setInterval(function(){ | |
textbox.textContent =textToSend[count] ; | |
textbox.dispatchEvent(event); | |
document.querySelector("button._35EW6").click(); | |
count++; | |
console.log("Sending message number : " + count); | |
if(count>2){ | |
console.log("I am inside clearInterval"); | |
clearInterval(messageLoop); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey there, thanks for this awesome script!
I have 2 doubts: