mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
iframe.contentdocument
This commit is contained in:
parent
7f398cda17
commit
2cfc939208
1 changed files with 17 additions and 0 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue