AdguardTeam / Scriptlets

AdGuard scriptlets library
GNU General Public License v3.0
150 stars 30 forks source link

Improve 'href-sanitizer' — add ability to modify the value #460

Closed slavaleleka closed 16 hours ago

slavaleleka commented 4 weeks ago

https://github.com/AdguardTeam/Scriptlets/issues/455#issuecomment-2372755158:

It'd be best if href's attributes can be modified at the same time.

For example, every video link in youtube search result page has a parameter "pp=[base64 encoded search query]" in it and it can't be got rid of with current options. Can we have another option for text and ?parameter to remove parameters in href, like $removeparam considering YouTube can add more private info in it. Sharing raw links from right click copy also exposes how the sharer found the video. $removeparam can only remove parameters after clicking on the link.

Other websites might shove in unnecessary, often tracking parameters as well. So I would like to see a combination of removeparam and href-santinizer

AdamWr commented 4 weeks ago

It would be also nice to have an option to remove hash from the link, a bit related to - https://github.com/AdguardTeam/Scriptlets/issues/135

For example, if there is a link like this one:

<a href="https://example.org/?article#utm_source=Facebook"></a>

it should be possible to remove #utm_source=Facebook.


Another hash related case - https://github.com/AdguardTeam/AdguardFilters/issues/191452 Example link:

https://www.novinky.cz/clanek/zahranicni-evropa-po-ctrnacti-letech-prvni-pruzkum-ktery-v-madarsku-nevyhral-orban-40494215#dop_ab_variant=0&dop_source_zone_name=novinky.sznhp.box&dop_id=40494215&source=hp&seq_no=2&utm_campaign=&utm_medium=z-boxiku&utm_source=www.seznam.cz