andstatus / andstatus

Multiple accounts client for multiple Social networks. For Android
http://andstatus.org/
Apache License 2.0
307 stars 69 forks source link

Remove tracking elements from URLs #545

Open Swrup opened 2 years ago

Swrup commented 2 years ago

Many websites use tracking elements in the URL (UTM parameters). They are not necessary for a website to be displayed or work correctly and can therefore be removed.

To protect users privacy, I propose to clean URLs from posts.

This can be easily implemented. The firefox add-on ClearURLs already does that and keep a list of UTM parameters to remove : https://gitlab.com/KevinRoebert/ClearUrls

See related issue for doing it on mastodon server: https://github.com/mastodon/mastodon/issues/16008

yvolk commented 2 years ago

@Swrup Thank you for suggestion. I agree with the comment: "I support the root request. Sadly, like the CleanURLs plugin... this is a fast moving target that regularly changes and will likely need to be maintained/updated to be effective."

For AndStatus this could be a global option that changes clickable URLs on the fly, so a User could try different options or even turn the feature on/off without losing original content.

The questions are: Q1. Who will maintain the tracking elements' configuration/parameters? As we don't have any antitracking service provider, the answer is: the User himself.

Q2. What are that configuration parameters, what are default values for them (this is what we will need to maintain in the source code!), what UI do we need to allow a User to maintain them, how should the app apply that parameters while cleaning an URL? @Swrup Could you analyze this and create the design / description ready for implementation in AndStatus? With reasonable configurability and not too hard for a User to understand and to have it working? Not just a link to another project that is hard to port to our app.

Swrup commented 2 years ago

Hello,

The most simple UI will be a "URL Tracking Protection On/Off" button in the settings with an additional text explaining what it does.

For removing trackers a file containing all the regex rules to apply is needed: https://gitlab.com/anti-tracking/ClearURLs/rules/-/raw/master/data.min.json

It is not a fast moving target, so it is fine to include it in the app. Maybe the most recent version can be automatically fetched by gradle when building the app?

Here is a well documented python example on how to use the rule file to clean urls: https://github.com/walterl/uroute/blob/master/uroute/url.py

This should be applied to every post before they are shown to the user. Or if possible only to a link when it is clicked, but before the user is redirected to the web page.

I hope this is helpful.

yvolk commented 2 years ago

OK, so no configuration except for turning it on/off for the start... @Swrup Thank you. Applying the removal algorithm on a link click looks like the safest way in terms of influence on the app performance.

opk12 commented 3 months ago

@yvolk What about calling an external URL cleaner app via API?

yvolk commented 3 months ago

@yvolk What about calling an external URL cleaner app via API?

We could use that. The main problem is to find such a service that is free for use and reasonably sustainable. What would be a way to earn money for that service in order to at least pay for its hosting and support?

opk12 commented 3 months ago

@yvolk Thank you. Léon is an excellent and maintained URL cleaner app, also available in F-droid. I opened a feature request so that

svenjacobs commented 3 weeks ago

Hello guys, developer of Leon here 👋🏼

I recently added the functionality to call Leon programmatically via Intents. Of course this requires the user to have Leon installed in order to work. There has been some discussion to extract the cleaning logic into a separate reusable library but there has been no development for this so far.