Detecting 229 code

This commit is contained in:
FlamedDogo99 2024-06-09 21:07:31 -06:00
parent dc446b3176
commit e4411c09a8

View File

@ -12,17 +12,10 @@
// @grant unsafeWindow // @grant unsafeWindow
// ==/UserScript== // ==/UserScript==
// THIS IS LAZY AND CAN EXPOSE INTERNALS // THIS IS LAZY AND DANGEROUS AND CAN EXPOSE USERSCRIPT INTERNALS SO PLEASE REMOVE
// IN THE FUTURE, JUST INJECT A SCRIPT TAG // IN THE FUTURE, JUST INJECT A SCRIPT TAG
//try {
//var window = unsafeWindow ?? window
//} catch {
//
//}
try { try {
if(unsafeWindow) { unsafeWindow.console.log("UNSAFE WINDOW RAGGHHH")
console.log("UNSAFE WINDOW RAGGHHH")
}
} catch { } catch {
Object.defineProperty(window, "unsafeWindow", { Object.defineProperty(window, "unsafeWindow", {
value: window value: window
@ -437,7 +430,7 @@ function insertCanvasElements() {
} }
}, false); }, false);
hiddenInput.addEventListener("keydown", function(e) { hiddenInput.addEventListener("keydown", function(e) {
if(!(e.key && e.keyCode && e.which) && !unsafeWindow.keyboardFix) { if((e.keyCode = 229 || e.which = 229) && !unsafeWindow.keyboardFix) {
unsafeWindow.console.warn("Switching from keydown to input events due to invalid KeyboardEvent. Some functionality will be lost.") unsafeWindow.console.warn("Switching from keydown to input events due to invalid KeyboardEvent. Some functionality will be lost.")
unsafeWindow.keyboardFix = true; unsafeWindow.keyboardFix = true;
if(unsafeWindow.lastKey) { if(unsafeWindow.lastKey) {