Cimbali / CleanLinks

Converts obfuscated/nested links to genuine clean links.
https://addons.mozilla.org/en-GB/firefox/addon/clean-links-webext/
Mozilla Public License 2.0
76 stars 2 forks source link

Helper for special symbols in parameters #143

Closed afjback closed 2 years ago

afjback commented 2 years ago

I want to clean one of facebook trackers, __cft__[0] example: https://www.facebook.com/aleksandr.kommari/posts/2430656763736654?__cft__[0]=AZUteNLFRkAw9jmMVXcchuJ9Zkaz1noRtWr-9-pGIrmQ_ZHcghHLpX5qj04DFx9SWTqIfXwbisle10uWmtuYn_9TJsHEiT2L62scm8vFSLY0vsQ9atvDDblojO-BVqD6Pl_l2pndFZzr5O5nXoAmA9OVHxzhNDyU0DHOpiQWYVZfDw&__tn__=%2CO%2CP-R When added from popup list, such parameter looks like __cft__%5B0%5D (and the rule doesn't work) "Simple" manual rule __cft__[0] doesn't work either. So I need to recall that [] symbols are special for regular expressions and need to be backslashed, thus the right rule __cft__\[0\] is pretty unobvious for average user. I think parameter dialog must either internally unescape %ed symbols, or warn about accidental special symbols.

Cimbali commented 2 years ago

Hi @afjback and thanks for reporting. So if I understand well there are several issues:

Cimbali commented 2 years ago

Okay so there’s another example of this on https://psyarxiv.com/

https://api.osf.io/v2/preprint_providers/?filter%5Bdomain%5D=https%3A%2F%2Fpsyarxiv.com%2F

Clicking the auto-clean link creates a filer%5Bdomain%5D rule, which should be filter\[domain\] so urldecode + regex escaping should be added.