mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-17 08:00:02 -04:00
scramitizer
This commit is contained in:
parent
c412959a5f
commit
118610cc99
6 changed files with 41 additions and 2 deletions
|
@ -51,6 +51,7 @@ export function createWrapFn(client: ScramjetClient, self: typeof globalThis) {
|
|||
};
|
||||
}
|
||||
|
||||
export const order = 4;
|
||||
export default function (client: ScramjetClient, self: typeof globalThis) {
|
||||
// the main magic of the proxy. all attempts to access any "banned objects" will be redirected here, and instead served a proxy object
|
||||
// this contrasts from how other proxies will leave the root object alone and instead attempt to catch every member access
|
||||
|
@ -61,6 +62,13 @@ export default function (client: ScramjetClient, self: typeof globalThis) {
|
|||
configurable: false,
|
||||
});
|
||||
|
||||
self.$scramitize = function (v) {
|
||||
if (typeof v === "string" && v.includes("scramjet")) {
|
||||
debugger;
|
||||
}
|
||||
return v;
|
||||
};
|
||||
|
||||
// location = "..." can't be rewritten as wrapfn(location) = ..., so instead it will actually be rewritten as
|
||||
// ((t)=>$scramjet$tryset(location,"+=",t)||location+=t)(...);
|
||||
// it has to be a discrete function because there's always the possibility that "location" is a local variable
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue