mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 22:40:01 -04:00
scramming my jet rn
Co-authored-by: Percs <Percslol@users.noreply.github.com> Co-authored-by: rifting <rifting@users.noreply.github.com>
This commit is contained in:
parent
1ea21280f8
commit
35782bec7e
6 changed files with 67 additions and 5 deletions
|
@ -1 +1,18 @@
|
|||
// the DAMN WINDOW PROXY
|
||||
const windowProxy = new Proxy(window, {
|
||||
get(target, prop) {
|
||||
const propIsString = typeof prop === "string";
|
||||
if (propIsString && prop === "location") {
|
||||
return target.__location;
|
||||
} else if (propIsString && ["window", "top", "parent", "self", "globalThis"].includes(prop)) {
|
||||
return target.__window;
|
||||
}
|
||||
|
||||
return target[prop];
|
||||
},
|
||||
|
||||
set(target, p, newValue, receiver) {
|
||||
return Reflect.set(target, p, newValue, receiver);
|
||||
},
|
||||
});
|
||||
|
||||
window.__window = windowProxy;
|
Loading…
Add table
Add a link
Reference in a new issue