Add new scriptlet — 'trusted-add-class'
The trusted-add-class would provide an opportunity to add any class name to an element. For example, sometimes it happens that a script checks the body class list.
example.com#%#//scriptlet('trusted-add-class', selector, classNames[, applying])
where
classNamescan be a single class or multiple classes separated by commas, e.g.fooorfoo,barapplyingcan beasap,completeandstaylike in remove-attr
Can be used on:
- myonlineradio.hu - bypass antiadblock.
https://github.com/AdguardTeam/Scriptlets/issues/431
I think that it can be achieved by using trusted-set-attr, for example:
example.org#%#//scriptlet('trusted-set-attr', 'div', 'class', 'foo bar')
Only the applying part is not supported, so I guess it could be implemented if necessary.
Does this construction assume that it will be usable when the div already has classes?
So that others will not disappear by default or pages will start checking the position in the attribute or even counting the number of white separating characters?