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

Google redirection clean not working: add decodeURIComponent() #73

Closed ltguillaume closed 4 years ago

ltguillaume commented 5 years ago

https://www.google.com/url?q=https://some.thing/forum/viewtopic.php%3Ft%3D4960084 is replaced by https://some.thing/forum/viewtopic.php%3Ft%3D4960084 which gives a 404, because decodeURIComponent() is not called beforehand. Doing this would result in https://some.thing/forum/viewtopic.php?t=4960084 and a correct loading of the address.

Waterfox 56, CleanLinks 3.2.7

Cimbali commented 5 years ago

Hi @ltGuillaume, thanks for reporting the bug. I’m suspecting this might be a duplicate of #67. Are you blocking javascript on google?

In any case, it seems the problem comes from the fact that Google should encode the URI component correctly, that is:

https://www.google.com/url?q=https%3A%2F%2Fsome.thing%2Fforum%2Fviewtopic.php%3Ft%3D4960084

Some websites use unencoded destination URLs, so we also detect those. If we fail to detect them, we then try with decoded URI Components. However this approach conflicts when the destination URL is ambiguously encoded ( like on google without javascript with : and / unencoded but ?, = and & encoded).

ltguillaume commented 5 years ago

I'm not using uMatrix, only uBlock Origin and I'm not blocking Javascript on Google.

It turns out my report was incomplete: though google.com search results get cleaned properly, Google's Custom Search results on other pages do not work. Example: https://torrentdownloads.be

Grossdm commented 4 years ago

I just tried the search on https://torrentdownloads.be/ and the results were cleaned for me.