Scriptlets icon indicating copy to clipboard operation
Scriptlets copied to clipboard

Add new scriptlet — 'trusted-json-set'

Open contribucious opened this issue 2 years ago • 3 comments

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

contribucious avatar Apr 10 '23 04:04 contribucious

🆕 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!

contribucious avatar May 22 '25 23:05 contribucious

🆕 Added in uBlock Origin 1.65.0 (related)

Thanks again to him!

Excited to see all this implemented in AdGuard products one day.

contribucious avatar Jun 17 '25 21:06 contribucious

👀 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.

contribucious avatar Sep 09 '25 12:09 contribucious