Revert "feat: proxy node.prototype.textcontent"

This reverts commit e57a654ecc.
totally broken implementation
This commit is contained in:
velzie 2024-10-07 17:38:06 -04:00
parent e57a654ecc
commit 26b5b76f72

View file

@ -1,14 +1,11 @@
import { SCRAMJETCLIENT } from "../../symbols"; import { SCRAMJETCLIENT } from "../../symbols";
import { ScramjetClient } from "../client"; import { ScramjetClient } from "../client";
import { nativeGetOwnPropertyDescriptor } from "../natives"; import { nativeGetOwnPropertyDescriptor } from "../natives";
import { decodeUrl, htmlRules, unrewriteHtml } from "../../shared";
import { import {
encodeUrl, encodeUrl,
decodeUrl,
rewriteCss, rewriteCss,
unrewriteCss,
htmlRules,
rewriteHtml, rewriteHtml,
unrewriteHtml,
rewriteJs, rewriteJs,
rewriteSrcset, rewriteSrcset,
} from "../../shared"; } from "../../shared";
@ -163,34 +160,6 @@ export default function (client: ScramjetClient, self: typeof window) {
}, },
}); });
client.Trap("Node.prototype.textContent", {
get(ctx) {
switch (ctx.this.tagName) {
case "SCRIPT":
return ctx.get();
case "STYLE":
return unrewriteCss(ctx.get() as string);
default:
return unrewriteHtml(ctx.get() as string);
}
},
set(ctx) {
switch (ctx.this.tagName) {
case "SCRIPT":
return ctx.get();
case "STYLE":
return rewriteCss(ctx.get() as string, client.meta);
default:
return rewriteHtml(
ctx.get() as string,
client.cookieStore,
client.meta,
false
);
}
},
});
client.Trap("Element.prototype.innerHTML", { client.Trap("Element.prototype.innerHTML", {
set(ctx, value: string) { set(ctx, value: string) {
let newval; let newval;