iframe.contentdocument

This commit is contained in:
velzie 2024-08-25 14:59:16 -04:00
parent 7f398cda17
commit 2cfc939208
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -162,6 +162,23 @@ export default function (client: ScramjetClient, self: typeof window) {
},
});
client.Trap("HTMLIFrameElement.prototype.contentDocument", {
get(ctx) {
const contentwindow =
client.descriptors["HTMLIFrameElement.prototype.contentWindow"].get;
const realwin = contentwindow.apply(ctx.this);
if (ScramjetClient.SCRAMJET in realwin.self) {
return realwin.self[ScramjetClient.SCRAMJET].documentProxy;
} else {
const newclient = new ScramjetClient(realwin.self);
newclient.hook();
return newclient.documentProxy;
}
},
});
client.Trap("TreeWalker.prototype.currentNode", {
get(ctx) {
return ctx.get();