Add new scriptlet — 'trusted-json-set'
Hello,
Basically, in the continuity of the json-prune scriptlet (and the $jsonprune modifier, allowing more advanced queries currently), it can be pretty neat and logical to have a trusted-json-set scriptlet (and a $jsonset modifier), I would say. To either define new or modify existing JSON properties, instead of pruning them.
Some websites / web apps (TF1, M6 too nowadays, etc.) require certain (ad-related) JSON properties to be both present and boolean. ↪️ Currently fixed using JS rules but hey … let's improve/simplify that! :wink:
Thank you very much! 👍
P.S. In a discussion I had a while ago with @ameshkov, there was talk of a possible untrusted version limited to true/false/etc. (i.e. a basic json-set scriptlet, thus following the same pattern as set-constant and trusted-set-constant), but probably still too risky though, I would say.
Related discussions:
- https://github.com/AdguardTeam/CoreLibs/issues/1447
- https://github.com/AdguardTeam/Scriptlets/issues/106
🆕 Added in uBlock Origin 1.64.0
💡 See also: Add tool to evaluate uBO-flavored JSONpath expressions (file has changed since)
Thank you very much, @gorhill!
🆕 Added in uBlock Origin 1.65.0 (related)
Thanks again to him!
Excited to see all this implemented in AdGuard products one day.
👀 Issue can probably be closed as should now be tracked here instead I guess: https://github.com/AdguardTeam/Scriptlets/issues/523 and https://github.com/AdguardTeam/Scriptlets/issues/522.