Last active
October 3, 2022 15:58
-
-
Save Mlocik97/d16f971822e0d631ea81bcd4bc277257 to your computer and use it in GitHub Desktop.
10ff.net hack
This file contains 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
const overlayNode = document.getElementsByClassName("overlayer").item(0); | |
const timeout = 20; | |
const config = { | |
subtree: true, | |
characterData: true, | |
}; | |
const layerObserver = new MutationObserver(mutated); | |
function mutated(mutations) { | |
mutations.forEach(function (mutation) { | |
if (mutation.target.wholeText == "false") { | |
const inputField = document.getElementsByTagName("input")[0]; | |
const inputEvent = new InputEvent("input"); | |
const interval = setInterval(() => { | |
try { | |
let word = document.querySelector(".highlight").textContent; | |
for (let i = 0; i < word.length; i++) { | |
inputField.value += word[i]; | |
inputField.dispatchEvent(inputEvent); | |
setTimeout(timeout); | |
} | |
inputField.value += " "; | |
inputField.dispatchEvent(inputEvent); | |
inputField.value = ""; | |
} catch { | |
clearInterval(interval); | |
} | |
}, timeout); | |
} | |
}); | |
} | |
layerObserver.observe(overlayNode, config); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment