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

Add rules for Tineye (and similar), update the google one and Searx urls. #99

Closed Rtizer-9 closed 4 years ago

Rtizer-9 commented 4 years ago

Please add default rules for:

  1. Tineye, Bing, Yandex and similar reverse search engines.

    Also update the url of that of google, I think the url (searchbyimage) has changed and the addons providing reverse search from context menu breaks due to this. (Please confirm first if it is the case).

  2. Searx search engine instances (https://searx.space/)

When you search for something which requires fetching images from wikipedia, it uses a image proxy which has url entry which cleanlinks intercept.

I think this particular issue can be ignored because searx has multiple instances and the best thing is that the exception for that image proxy can be added then and there because it follow same format everytime without and uid.

So I just thought of bringing it to your attention, if you'd like to add some regex which covers the most (if not all) used searx instances; although I personally agree it can be easily ignored because of above mentioned reason.

I also request you to make some changes in UI and handling of rules if that's possible which makes it easy for user to differentiate between default rules and the rules added by their own. A simple indicator would suffice in cases where a user wants to make a decision as to whether its a default rule which was thoughtfully added after checking OR it was added by myself which NOW requires some modification in an error case.

As a long time cleanlinks user it becomes hard to remember which is a default rule and which was custom added, especially considering the amount of variance in paths for a single domain like that of google's.

Cimbali commented 4 years ago

The rules now show whether they are default or user-made in the preferences since v4.1 (released right now).

Cimbali commented 4 years ago
Cimbali commented 4 years ago

On searx URLs if I understand well, these can be on any domain, is that right? Anyone can add their own instance if I read their website well. So that will have to be a rule with domain *.* and the path being matched exactly. Right now, from what I can see:

I must say there’s a couple of proxies that claim to be anti-tracking that we break (another one would be duckduckgo). That’s because while we successfully shortcut the proxy to a valid image, the restrictive Content Security Policy on those pages prevents cross-domain requests to prevent leaking our activity.

I think those are reasonable use case that require to be whitelisted. However we must be wary of a couple of things in the future:

Cimbali commented 4 years ago

Actually duckduckgo is even a little more perverse. it doesn’t use restrictive policies. So technically, there, cleaning the links is leaking our activity when the proxy is trying to hide it.

Rtizer-9 commented 4 years ago

I think the engine url has lots of variations and different addons and country are using different urls thus the breakage.

One such url is https://www.google.com/imghp?hl=en

I'm using https://addons.mozilla.org/en-US/firefox/addon/selection-context-search/

https://www.tineye.com/search?url=https://avatars1.githubusercontent.com/u/35103368?s=120&v=4

which as you can see will be redirected.

One question: Is it a good practice to introduce more issues completely unrelated to the current issue in the SAME thread coz I don't really know if this is more convenient for the developer (you) or he gets irritated and wants the users to create new threads for new issues.

PS: I'm having a bit of a hard time dealing with how to write the content in proper way in github so please bear with me. Thanks

Cimbali commented 4 years ago

Interesting, that tineye URL is not what happens when you paste an URL to the search box. I’ve also added it now, and changed the /searchbyimage as you suggested.

For where and how to post, don’t worry about it, no irritation here. Usually best practices are to keep a single topic per issue and open a new one for new topics. It doesn’t really matter though as I get notifications for all of the comments on this repository, so wherever you post something I’ll see it (and eventually get around to it).

Rtizer-9 commented 4 years ago

The issue was actually that when you are on a page which requires you to login to google or github then it doesn't login because of cleanlinks redirection and forms an infinited loop.

Eg case: go to a website where they have a youtube channel and click to subscribe button, its going to redirect you to login page but when you put credentials and try to login, you will again get redirected. The reason is I think that in such particular cases the url contains the redirecting url of that particular channel and thus cleanlinks intercepts it inbetween.

You can replicate the issue by going to any youtube channel, clicking on the subscribe button and now because of redirections you'll get a "something went wrong, try again" error.

Cimbali commented 4 years ago

I also added some github / youtube accounts / google accounts rules, hope they cover all the cases. New version released now on AMO.

Rtizer-9 commented 4 years ago

Everything is fixed now :+1:

Can you please make a separate preference page for cleanlinks since the options/features are getting more and more complex and thus hard to manage in firefox about:addons page.

Something like https://addons.mozilla.org/en-US/firefox/addon/requestcontrol/ has implemented. Its far more inferior in comparison but the addon preference page looks extremely organized and easy to work with.

Cimbali commented 4 years ago

I see their add-on is much prettier indeed. Let’s track that in a separate issue, #102.

On the rules, the updater compares default rules with previous default rules:

So if you modified a rule, it will not be removed when updating as it is not the same as the old default rule anymore. If a new default rule is introduced that matches your existing or modified rule, they will be merged, and if they are exactly the same that means that (a) this rule won’t be changed in your rules file, and (b) this rule which was previously modified is now shown as default, because it matches the new default rules.