This commit is contained in:
Percs 2024-07-16 17:42:21 -05:00
parent fa779017ad
commit d6dd1d4ca3
20 changed files with 363 additions and 379 deletions

View file

@ -12,7 +12,7 @@ export const windowProxy = new Proxy(window, {
) {
return windowProxy;
} else if (propIsString && prop == "parent") {
return window.parent
return window.parent;
} else if (propIsString && prop === "$scramjet") {
return;
} else if (propIsString && prop === "addEventListener") {
@ -27,7 +27,6 @@ export const windowProxy = new Proxy(window, {
const value = Reflect.get(target, prop);
// this is bad! i don't know what the right thing to do is
if (typeof value === "function") {
return new Proxy(value, {
@ -55,7 +54,6 @@ export const windowProxy = new Proxy(window, {
},
});
export const documentProxy = new Proxy(document, {
get(target, prop) {
const propIsString = typeof prop === "string";
@ -78,7 +76,6 @@ export const documentProxy = new Proxy(document, {
},
set(target, prop, newValue) {
if (typeof prop === "string" && prop === "location") {
//@ts-ignore
location = new URL(encodeUrl(newValue));
@ -86,5 +83,5 @@ export const documentProxy = new Proxy(document, {
}
return Reflect.set(target, prop, newValue);
}
},
});