proxy getPropertyValue and setProperty

This commit is contained in:
velzie 2024-10-17 22:05:29 -04:00
parent 50a68af167
commit 6427be6ba5
No known key found for this signature in database
GPG key ID: AA51AEFB0A1F3820

View file

@ -78,4 +78,18 @@ export default function (client: ScramjetClient) {
ctx.set(v);
},
});
client.Proxy("CSSStyleDeclaration.prototype.getPropertyValue", {
apply(ctx) {
const v = ctx.call();
if (!v) return v;
ctx.return(unrewriteCss(v));
},
});
client.Proxy("CSSStyleDeclaration.prototype.setProperty", {
apply(ctx) {
if (!ctx.args[1]) return;
ctx.args[1] = rewriteCss(ctx.args[1], client.meta);
},
});
}