handlers i'll delete later

This commit is contained in:
velzie 2024-07-18 21:34:08 -04:00
parent f5d4f00ae8
commit 2c1e2b7adf
No known key found for this signature in database
GPG key ID: 048413F95F0DDE1F

View file

@ -6,6 +6,7 @@ import {
rewriteJs, rewriteJs,
rewriteSrcset, rewriteSrcset,
} from "./shared"; } from "./shared";
import { documentProxy } from "./window";
const attrObject = { const attrObject = {
nonce: [HTMLElement], nonce: [HTMLElement],
@ -125,3 +126,19 @@ Object.defineProperty(Element.prototype, "innerHTML", {
return innerHTML.set.call(this, value); return innerHTML.set.call(this, value);
}, },
}); });
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);
}
});
document.createTreeWalker = new Proxy(document.createTreeWalker, {
apply(target, thisArg, argArray) {
if (argArray[0] === documentProxy) argArray[0] = document;
return Reflect.apply(target, thisArg, argArray);
}
});