mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-13 06:20:02 -04:00
fix: element.innerhtml trap
This commit is contained in:
parent
7eea45c5c7
commit
6882ceff9b
1 changed files with 5 additions and 2 deletions
|
@ -206,7 +206,11 @@ export default function (client: ScramjetClient, self: typeof window) {
|
||||||
} else if (ctx.this instanceof self.HTMLStyleElement) {
|
} else if (ctx.this instanceof self.HTMLStyleElement) {
|
||||||
newval = rewriteCss(value, client.meta);
|
newval = rewriteCss(value, client.meta);
|
||||||
} else {
|
} else {
|
||||||
|
try {
|
||||||
newval = rewriteHtml(value, client.cookieStore, client.meta);
|
newval = rewriteHtml(value, client.cookieStore, client.meta);
|
||||||
|
} catch {
|
||||||
|
newval = value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.set(newval);
|
ctx.set(newval);
|
||||||
|
@ -239,7 +243,6 @@ export default function (client: ScramjetClient, self: typeof window) {
|
||||||
return unrewriteHtml(ctx.get());
|
return unrewriteHtml(ctx.get());
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
client.Proxy("Element.prototype.insertAdjacentHTML", {
|
client.Proxy("Element.prototype.insertAdjacentHTML", {
|
||||||
apply(ctx) {
|
apply(ctx) {
|
||||||
if (ctx.args[1])
|
if (ctx.args[1])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue