fix ownerDocument

This commit is contained in:
velzie 2024-08-25 11:01:05 -04:00
parent bb4b7f127b
commit 9a39435c7d
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -177,7 +177,13 @@ export default function (client: ScramjetClient, self: typeof window) {
client.Trap("Node.prototype.ownerDocument", { client.Trap("Node.prototype.ownerDocument", {
get(ctx) { get(ctx) {
return client.documentProxy; let doc = ctx.get() as Document | null;
if (!doc) return null;
let scram: ScramjetClient = doc[ScramjetClient.SCRAMJET];
if (!scram) return doc; // ??
return scram.documentProxy;
}, },
}); });
} }