Skip to content

Instantly share code, notes, and snippets.

@alexunderboots
Forked from stil/ProxmoxAutoType.js
Created January 23, 2025 14:42
Show Gist options
  • Save alexunderboots/0277bfd50776169786a100c32e7c11e3 to your computer and use it in GitHub Desktop.
Save alexunderboots/0277bfd50776169786a100c32e7c11e3 to your computer and use it in GitHub Desktop.
Auto type in noVNC (Proxmox)
(async () => {
const text = prompt("Enter text to type:");
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const input = document.getElementById("noVNC_keyboardinput");
const keydown = (key) => input.dispatchEvent(new KeyboardEvent("keydown", { key }));
for (let i = 0; i < text.length; i++) { keydown(text[i]); await sleep(50); }
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment