-3
IMPORTANT: This is for an extension to Chrome, not for illicit attitude. Don’t give Down Vote without stating the reason, please.
How could I insert a text in the Whatsapp message div and activate the send button with pure js?
Even with textContent on div, but the send button does not appear.
Could someone help me?
That is the code:
suggestion.addEventListener('click', (event) => {
const inputText = document.querySelector('div._2FVVk._2UL8j')
inputText.classList.add('focused')
const textBox = document.querySelector('#main > footer > div._3ee1T._1LkpH.copyable-area > div._3uMse > div > div._3FRCZ.copyable-text.selectable-text')
textBox.textContent = event.target.textContent
document.querySelector('span[data-icon="send"]').click()
})