mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-16 07:30:02 -04:00
proxy getPropertyValue and setProperty
This commit is contained in:
parent
50a68af167
commit
6427be6ba5
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue