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(
|
||||
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 target of [Node.prototype, MutationObserver.prototype, document]) {
|
||||
for (const prop in target) {
|
||||
try {
|
||||
if (typeof target[prop] === "function") {
|
||||
|
@ -154,4 +143,3 @@ for (const target of [Node.prototype, document]) {
|
|||
} catch (e) { }
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue