diff --git a/src/client/shared/requests/beacon.ts b/src/client/shared/requests/beacon.ts index 495cbc3..ccba7e3 100644 --- a/src/client/shared/requests/beacon.ts +++ b/src/client/shared/requests/beacon.ts @@ -2,7 +2,7 @@ export default function (client, self) { // goodybye spyware~ client.Proxy("navigator.sendBeacon", { apply(ctx) { - ctx.return(null); + ctx.return(true); }, }); } diff --git a/src/client/shared/requests/fetch.ts b/src/client/shared/requests/fetch.ts index 3a0893e..56c357e 100644 --- a/src/client/shared/requests/fetch.ts +++ b/src/client/shared/requests/fetch.ts @@ -1,6 +1,7 @@ // ts throws an error if you dont do window.fetch import { isemulatedsw } from "../.."; +import { decodeUrl } from "../../../shared/rewriters/url"; import { ScramjetClient } from "../../client"; import { encodeUrl, rewriteHeaders } from "../../shared"; @@ -31,9 +32,21 @@ export default function (client: ScramjetClient, self: typeof globalThis) { }, }); - client.Proxy("Response.redirect", { - apply(ctx) { - ctx.args[0] = encodeUrl(ctx.args[0]); + client.Trap("Response.prototype.url", { + get(ctx) { + return decodeUrl(ctx.get() as string); }, }); + + client.Trap("Request.prototype.url", { + get(ctx) { + return decodeUrl(ctx.get() as string); + }, + }); + + // client.Proxy("Response.redirect", { + // apply(ctx) { + // ctx.args[0] = encodeUrl(ctx.args[0]); + // }, + // }); } diff --git a/src/client/shared/wrap.ts b/src/client/shared/wrap.ts index 38a1eb9..3525ef6 100644 --- a/src/client/shared/wrap.ts +++ b/src/client/shared/wrap.ts @@ -89,7 +89,7 @@ export default function (client: ScramjetClient, self: typeof globalThis) { } } self.$scramerr = function scramerr(e) { - // console.warn("CAUGHT ERROR", e); + console.warn("CAUGHT ERROR", e); }; self.$scramdbg = function scramdbg(args, t) {