feat: proxy domparser.parsefromstring

This commit is contained in:
Percs 2024-10-07 10:07:34 -05:00
parent 778464a862
commit ebf3c9c4c4

View file

@ -257,6 +257,19 @@ export default function (client: ScramjetClient, self: typeof window) {
},
});
client.Proxy("DOMParser.prototype.parseFromString", {
apply(ctx) {
if (ctx.args[1] === "text/html") {
ctx.args[0] = rewriteHtml(
ctx.args[0],
client.cookieStore,
client.meta,
true
);
}
},
});
client.Proxy("document.write", {
apply(ctx) {
ctx.args[0] = rewriteHtml(