Created
January 28, 2018 15:38
-
-
Save kevinresol/f5253d148d5a37201b3e53f2b4fa70b2 to your computer and use it in GitHub Desktop.
Automate message sending in active chat for Whatsapp Web
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
function send(message) { | |
var input = document.querySelector('div.pluggable-input-body.copyable-text.selectable-text'); | |
input.innerText = message; | |
input.dispatchEvent(new InputEvent('input', { | |
inputType: 'insertText', | |
data: message, | |
bubbles: true, | |
cancelable: false, | |
composed: true, | |
detail: 0, | |
})); | |
document.querySelector('button.compose-btn-send').click(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment