Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/Cimbali/CleanLinks

Converts obfuscated/nested links to genuine clean links.
https://github.com/Cimbali/CleanLinks

firefox-webextension links privacy-protection

Last synced: 17 days ago
JSON representation

Converts obfuscated/nested links to genuine clean links.

Awesome Lists containing this project

README

        

# CleanLinks Mozilla Firefox Extension ![rating on addons.mozilla.org via shields.io][amo_stars] ![users on addons.mozilla.org via shields.io][amo_users]

[![Install it from addons.mozilla.org][get_addon_image]][addon]

CleanLinks was initially a webextension rewrite and is now a fork of [@DiegoCR](https://github.com/diegocr)’s original [XUL/XPCOM CleanLinks extension](https://github.com/diegocr/CleanLinks).

## What does it do?
CleanLinks protects your private life, by automatically detecting and skipping redirect pages, that track you on your way to the link you really wanted. Tracking parameters (e.g. utm\_\* or fbclid) are also removed.

_Eg:_
- ➠
- ➠
- javascript:window.open('http://somesite.com') ➠

For maximum privacy, rules are maintained and editable locally (with decent defaults distributed in the add-on). CleanLinks will break some websites and you will need to manually whitelist these URLs for them to work. This can be done easily via the menu from the CleanLinks icon.

You can [test the current (master) link cleaning code online](https://cimbali.github.io/CleanLinks/), by pasting a link in the text area and clicking the "Clean it!" button.

## More details

This add-on protects your private life, by skipping intermediate pages that track you while redirecting you to your destination (1), or that divulge your current page while making requests (2). Any request that contains another URL is considered fishy, and skipped in favor of the target page (for foreground requests) or dropped (for background requests). A whitelist manages the pages and websites that have legitimate uses (3) of such redirects.

Some illustrative examples are:
1. Facebook tracks all the outgoing links by first sending you to the page `https://l.facebook.com/l.php?u=` which then redirects you to the URL.
2. Analytics report the page you are on, for example google analystics uses `https://www.google-analytics.com/collect?dl=&`
3. Logging in through openid requires to pass the original URL so you can return to that page once the login is performed, e.g. `https://github.com/login/oauth/authorize?redirect_uri=&`

All these embedded links are detected automatically. Links of type 1 should be redirected to their destination, those of type 2 (identified by the fact they are not “top-level” requests) should be dropped, and those of type 3 allowed through a witelist.

The whitelist is populated with a few sensible defaults, and must be maintained manually by each user as they encounter pages that break. A quick access to the last requests that were cleaned is available by clicking on the add-on icon. In this popup, all recently cleaned links for the tab appear, and these can be added to the whitelist definitively (“Whitelist Embedded URL” button) or for once only (“Open Un-cleaned Link” button).

Other tracking data can be added to the URLs to follow your behaviour online. These can be for example `fbclid=` or `utm_campain=` query parameters, or `/ref=` in the pathname of the URL on amazon.
Those can not be detected automatically, so CleanLinks has a set of rules (the same that maintains the embedded URL whitelist) that specifies which data is used for tracking and should be removed from URLs.

## How can I help?

Be part of the open-source community that helps each other browse safer and more privately !

Being part of a community means being respectful of everyone and keeping this environment friendly, welcoming, and harrasment-free.
Abusive behaviour will not be tolerated, and can be reported by email at [email protected] − wrongdoers may be permanently banned from interacting with CleanLinks.

### You can help by reporting issues!

Any reports are welcome, including suggestions to improve and maintain the default rules that CleanLinks uses.

### You can help by contributing to the code!

Maintaining even a small addon like CleanLinks is in fact very time consuming, so every little bit helps!

### You can help by contributing to translations!

You can improve translations or add a new language [on CleanLink’s POEditor page](https://poeditor.com/join/project/H3u6Cttc4j), where the strings will directly be imported into the add-on at the next release.

This is the current status of translations:

![Chinese](https://img.shields.io/poeditor/progress/323337/zh-CN?token=7a666b44c0985d16a7b59748f488275c&label=%F0%9F%87%A8%F0%9F%87%B3%20Chinese)
![Chinese (TW)](https://img.shields.io/poeditor/progress/323337/zh-TW?token=7a666b44c0985d16a7b59748f488275c&label=%F0%9F%87%B9%F0%9F%87%BC%20Chinese%20%28TW%29)
![French](https://img.shields.io/poeditor/progress/323337/fr?token=7a666b44c0985d16a7b59748f488275c&label=%F0%9F%87%AB%F0%9F%87%B7%20French)
![German](https://img.shields.io/poeditor/progress/323337/de?token=7a666b44c0985d16a7b59748f488275c&label=%F0%9F%87%A9%F0%9F%87%AA%20German)
![Spanish](https://img.shields.io/poeditor/progress/323337/es?token=7a666b44c0985d16a7b59748f488275c&label=%F0%9F%87%AA%F0%9F%87%B8%20Spanish)

## Why are the requested permissions required?

The permissions are listed [in the manifest file](https://github.com/Cimbali/CleanLinks/blob/master/addon/manifest.json#L14)
and [described in the API documentation](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/permissions#API_permissions).
Here is a breakdown of why we need each of the requested permissions:

| Permission | Show (on addons.mozilla.org) as | Needed for |
| ------------------------------------------------------ | ----------------------------------- | ----------------------------------------------- |
| clipboardWrite | _Input data to the clipboard_ | Copying cleaned links from the context menu |
| contextMenus | Not shown | Copying cleaned links from the context menu |
| alarms | Not shown | Automatically saving options |
| webRequest | _Access your data for all websites_ | Clean links while they are accessed |
| webRequestBlocking | _Access your data for all websites_ | Clean links while they are accessed |
| \ | _Access your data for all websites_ | Clean javascript links, highlight cleaned links |
| storage | Not shown | Store rules and preferences |
| | Not shown | Identifying public suffixes (e.g. `.co.uk`) |

## In which other ways can you get it?

Except from the AMO page , you can also get the addon straight from this repo.
This is useful if you want to help testing for example.

- Either get [web-ext](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Getting_started_with_web-ext), and run `web-ext run` in the `addon/` source code directory.

- Alternately, [temporarily load the add-on from `about:debugging#addons`](https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Temporary_Installation_in_Firefox), by ticking "Enable add-on debugging", clicking "Load Temporary Add-on" and selecting the `manifest.json` file from the source code directory.

- Finally, you can build the add-on using `yarn bundle` or `web-ext -s ./addon -a ./dist build` in this repository’s top-level directory, and [install the add-on from the file that was generated](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Distribution_options/Sideloading_add-ons#Using_Install_Add-on_From_File).

[addon]: https://addons.mozilla.org/addon/clean-links-webext/
[license]: https://img.shields.io/github/license/Cimbali/CleanLinks.svg?style=popout-square&logo=mozilla&colorA=333333&colorB=coral
[amo_stars]: https://img.shields.io/amo/stars/clean-links-webext.svg?style=popout-square&logo=mozilla-firefox
[amo_users]: https://img.shields.io/amo/users/clean-links-webext.svg?style=popout-square&logo=mozilla-firefox&colorB=blue
[get_addon_image]: https://cimbali.github.io/CleanLinks/get-the-addon-small.png