apiraino / link_cleaner

A Firefox extension to clean urls from tracking and advertisement parameters
82 stars 10 forks source link
extensions privacy-enhancing-technologies tracking

Link Cleaner+ Link Cleaner+

This project is a fork of Link Cleaner, a Firefox extension to sanitize links removing all tracking parameters. This fork would like to keep the original project alive. We have a roadmap and a list of items (features and bugs) open up for grabs. Contributions are welcome!

Why "Link Cleaner+"

The original project seems to have stalled, issues and pull requests don't get through. We will try picking up where the original project left and move forward. You can install Link Cleaner+ from the Mozilla Add-ons website.

How does it work?

Links are checked and sanitized before any further action is performed (browser redirect, open tab, copy link). Sanitization is performed based on a blacklist.

Feature list:

You can now visit and bookmark clean links instead of the long, tracking-enabled ones!

Link Cleaner+ is a work in progress, contributions and suggestions are welcome!

Examples:

utm_* removal
Original http://meyerweb.com/eric/thoughts/2017/03/07/welcome-to-the-grid/?utm_source=frontendfocus&utm_medium=email
Sanitized http://meyerweb.com/eric/thoughts/2017/03/07/welcome-to-the-grid
Amazon item URL
Original https://www.amazon.com/AmazonBasics-Type-C-USB-Male-Cable/dp/B01GGKYQ02/ref=sr_1_1?s=amazonbasics&srs=10112675011&ie=UTF8&qid=1489067885&sr=8-1&keywords=usb-c
Sanitized https://www.amazon.com/dp/B01GGKYQ02
Facebook redirect
Original https://l.facebook.com/l.php?u=https%3A%2F%2Fwww.fsf.org%2Fcampaigns%2F&h=ATP1kf98S0FxqErjoW8VmdSllIp4veuH2_m1jl69sEEeLzUXbkNXrVnzRMp65r5vf21LJGTgJwR2b66m97zYJoXx951n-pr4ruS1osMvT2c9ITsplpPU37RlSqJsSgba&s=1
Sanitized https://www.fsf.org/campaigns
Reddit redirect
Original https://out.reddit.com/t3_5pq7qd?url=https%3A%2F%2Finternethealthreport.org%2Fv01%2F&token=AQAAZV6JWHBBnIcVjV1wvxVg5gKyCQQSdUhGIvuEUmdPZhxhm8kH&app_name=reddit.com
Sanitized https://internethealthreport.org/v01/
Steam redirect
Original https://steamcommunity.com/linkfilter/?url=https://getfedora.org/
Sanitized https://getfedora.org/

For a full list of test cases, have a look at the included test_urls.html file.

Comparison to other add-ons

Unlike other legacy add-ons, Link Cleaner+ doesn't inject JavaScript into pages to change links. Instead, it listens to main url requests and changes them (if needed) to remove redirects or tracking.

That means it's doing less unneeded work and consumes less resources (memory and CPU).

Warnings

Test the extension locally

You can use the web-ext package to keep things easier (see documentation and how to install).

Install Use the provided script web-ext-run.sh to launch Firefox with a dedicated profile. The add-ons is already installed and the browser will open on the test HTML page.

Notice that since the profile is created at runtime, preferences saved by the extension will be lost once the browser will be closed (unless the parameter --keep-profile-changes is added to the web-ext-run.sh script.

The profile should be located in /tmp.

Enable extension debugging from about:debugging to see logging.

Test the extension locally in normal Firefox profile

First, deactivate/uninstall AMO-installed add-on. Then, visit about:debugging#/runtime/this-firefox, and use "Load Temporary Add-on..." to select the manifest.json file in this directory. It will be unloaded when Firefox restarts.

Build extension for publishing

# not signed, local installation (load from about:debugging#/runtime/this-firefox)
$ rm -f ~/tmp/link_cleaner_x.y.zip
$ zip -r -FS ~/tmp/link_cleaner_x.y.xpi manifest.json *.js _locales/ options/ assets/icon*
# build and sign for publishing on AMO
$ export AMO_JWT_ISSUER=user:12345:67
$ export AMO_JWT_SECRET=634f34b...
$ web-ext sign --api-key=$AMO_JWT_ISSUER --api-secret=$AMO_JWT_SECRET -i web-ext-run.sh
$ ls web-ext-artifacts/
link_cleaner_x.y.zip

Credits

Original work: Link Cleaner

Icons made by Daniel Bruce and Good Ware from Flaticon licensed by CC 3.0 BY.

License

Released under the GPLv3 license