return real window.parent

This commit is contained in:
velzie 2024-07-27 18:55:59 -04:00
parent 396170e4ea
commit b0f5166916
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F
4 changed files with 62 additions and 38 deletions

View file

@ -1,5 +1,6 @@
import { encodeUrl } from "../shared/rewriters/url";
import { ScramjetClient } from "./client";
import { wrapfn } from "./shared/wrap";
export function createWindowProxy(
client: ScramjetClient,
@ -12,11 +13,9 @@ export function createWindowProxy(
return client.locationProxy;
} else if (
propIsString &&
["window", "top", "self", "globalThis"].includes(prop)
["window", "top", "self", "globalThis", "parent"].includes(prop)
) {
return client.windowProxy;
} else if (propIsString && prop == "parent") {
return self.parent;
return self[wrapfn](self[prop]);
} else if (propIsString && prop === "$scramjet") {
return;
}