Added warning for testing

This commit is contained in:
FlamedDogo99 2024-06-09 21:52:05 -06:00
parent 54b32e6034
commit 9b19b2c01f

View File

@ -16,6 +16,7 @@
// IN THE FUTURE, JUST INJECT A SCRIPT TAG // IN THE FUTURE, JUST INJECT A SCRIPT TAG
try { try {
unsafeWindow.console.log("UNSAFE WINDOW RAGGHHH") unsafeWindow.console.log("UNSAFE WINDOW RAGGHHH")
alert("DANGER: This userscript is temporarily using unsafeWindow for testing purposes. Unsafe websites could potentially use this to gain access to data and other content that the browser normally wouldn't allow!")
} catch { } catch {
Object.defineProperty(window, "unsafeWindow", { Object.defineProperty(window, "unsafeWindow", {
value: window value: window
@ -404,6 +405,7 @@ function insertCanvasElements() {
hiddenInput.style.cssText = "position:absolute;top: 0vh; margin: auto; left: 8vh; right:0vh; width: 8vh; height: 8vh;font-size:20px;z-index:10"; hiddenInput.style.cssText = "position:absolute;top: 0vh; margin: auto; left: 8vh; right:0vh; width: 8vh; height: 8vh;font-size:20px;z-index:10";
hiddenInput.value = " " //Allows delete to be detected before input is changed hiddenInput.value = " " //Allows delete to be detected before input is changed
hiddenInput.addEventListener("input", function(e) { hiddenInput.addEventListener("input", function(e) {
e.stopImmediatePropagation();
e.preventDefault(true); e.preventDefault(true);
let inputData = e.data == null ? "delete" : e.data.slice(-1); let inputData = e.data == null ? "delete" : e.data.slice(-1);
unsafeWindow.console.log(`Received input by ${e.inputType}: ${e.data} -> ${inputData}`); unsafeWindow.console.log(`Received input by ${e.inputType}: ${e.data} -> ${inputData}`);