Last active
January 23, 2025 14:42
-
-
Save stil/54052d846c9e77e9da4f79af4c831bf5 to your computer and use it in GitHub Desktop.
Auto type in noVNC (Proxmox)
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 () => { | |
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
Here's a minified bookmarklet based on @rmb122 's answer