mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
proxy treewalker currentNode to not use fake document
This commit is contained in:
parent
b0f5166916
commit
8d2f23badb
1 changed files with 13 additions and 0 deletions
|
@ -155,6 +155,19 @@ export default function (client: ScramjetClient, self: typeof window) {
|
|||
},
|
||||
});
|
||||
|
||||
client.Trap("TreeWalker.prototype.currentNode", {
|
||||
get(ctx) {
|
||||
return ctx.get();
|
||||
},
|
||||
set(ctx, value) {
|
||||
if (value == client.documentProxy) {
|
||||
return ctx.set(self.document);
|
||||
}
|
||||
|
||||
return ctx.set(value);
|
||||
},
|
||||
});
|
||||
|
||||
for (const target of [
|
||||
self.Node.prototype,
|
||||
self.MutationObserver.prototype,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue