Skip to content

Instantly share code, notes, and snippets.

@alexcmgit
Last active April 8, 2021 16:54
Show Gist options
  • Save alexcmgit/3eaaaa1874814a8f02bfa9ea71200ffa to your computer and use it in GitHub Desktop.
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
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