mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
move mutob proxy into the document catcher
This commit is contained in:
parent
084f2cd789
commit
ec5ef8e03f
1 changed files with 1 additions and 13 deletions
|
@ -128,18 +128,7 @@ Object.defineProperty(Element.prototype, "innerHTML", {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
MutationObserver.prototype.observe = new Proxy(
|
for (const target of [Node.prototype, MutationObserver.prototype, document]) {
|
||||||
MutationObserver.prototype.observe,
|
|
||||||
{
|
|
||||||
apply(target, thisArg, argArray) {
|
|
||||||
if (argArray[0] === documentProxy) argArray[0] = document;
|
|
||||||
|
|
||||||
return Reflect.apply(target, thisArg, argArray);
|
|
||||||
},
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const target of [Node.prototype, document]) {
|
|
||||||
for (const prop in target) {
|
for (const prop in target) {
|
||||||
try {
|
try {
|
||||||
if (typeof target[prop] === "function") {
|
if (typeof target[prop] === "function") {
|
||||||
|
@ -154,4 +143,3 @@ for (const target of [Node.prototype, document]) {
|
||||||
} catch (e) { }
|
} catch (e) { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue