Last active
April 8, 2021 16:54
-
-
Save alexcmgit/3eaaaa1874814a8f02bfa9ea71200ffa to your computer and use it in GitHub Desktop.
Só copiar e colar no devtools e chamar a função sendMessage com uma string separada por quebra de linha
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
async function sendText(scriptText) { | |
const lines = scriptText.split("\n"); | |
for (const line of lines) { | |
if (line.trim() != "") { | |
console.log(lines); | |
window.InputEvent = window.Event || window.InputEvent; | |
const event = new InputEvent("input", { bubbles: true }); | |
const textbox = document.querySelector('div._2_1wd[data-tab="6"]'); | |
textbox.textContent = line; | |
textbox.dispatchEvent(event); | |
document.querySelector("button._1E0Oz").click(); | |
await new Promise((r, j) => setTimeout(r, 1000 * 60)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment