Giter VIP home page Giter VIP logo

cleanlinks's Introduction

CleanLinks Mozilla Firefox Extension rating on addons.mozilla.org via shields.io users on addons.mozilla.org via shields.io

Install it from addons.mozilla.org

CleanLinks was initially a webextension rewrite and is now a fork of @DiegoCR’s original XUL/XPCOM CleanLinks extension.

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:

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, 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=<the actual link here> 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=<your current page>&<more info on what you do>
  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=<URL to the previous page>&<more parameters for the request>

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, where the strings will directly be imported into the add-on at the next release.

This is the current status of translations:

Chinese Chinese (TW) French German Spanish

Why are the requested permissions required?

The permissions are listed in the manifest file and described in the API documentation. 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
<all_urls> Access your data for all websites Clean javascript links, highlight cleaned links
storage Not shown Store rules and preferences
https://publicsuffix.org/list/public_suffix_list.dat Not shown Identifying public suffixes (e.g. .co.uk)

In which other ways can you get it?

Except from the AMO page https://addons.mozilla.org/addon/clean-links-webext/, you can also get the addon straight from this repo. This is useful if you want to help testing for example.

cleanlinks's People

Contributors

allgreed avatar cimbali avatar diegocr avatar ede123 avatar quelbs avatar yume-chan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cleanlinks's Issues

shhh! could you be quiteter?

please consider adding options to disable red count badge on icon, and notifications (they are very nice and system integrated, just not needed for some).

——

As this is „n°1” issue, i'd like to say THANK YOU. Glad someone finally picked up this great project.

Domain whitelisting via menu

It would be great if the add-on allowed to white list domains (for simplicity sake the domain of the address bar) via its menu or alternatively, each domain which matches the rewrite rules.

Reduntant youtube embeds rewrites

handle `data:image/...` loading

Inline svg images, e.g. data:image/svg+xml;<svg ...>...</svg> or in base64 data:image/svg+xml;base64, contain legitimate links that are not redirects (typically XML namespaces). We should avoid clearing those.

Maybe even avoid clearing anything starting with data: ?

We probably need to investigate what happens when external resources are loaded from an svg file with the <use /> tag, as this seems a type of redirect that might be used from within svg images.

Support alternate browsers

  • Chrome
  • Vivaldi (built on chromium & uses the Chrome Web Store, should be no compared to Chrome)
  • Opera, see #109
  • Firefox on Android, see #30

Doesnt Work on ip-check.info

My Browser (FF ESR 60 64 bit on W7) remains stuck on the homepage of the site http://ip-check.info .

Whitelisting this site doesn't help.

How to make CleanLinks works on this site, sending me on the results page?

Are all the permissions really required?

From the Mozilla add-on webpage:

Permissions

This add-on can:

  • Access your data for all websites
  • Input data to the clipboard
  • Display notifications to you

I'm curious if the last two are really required.

suggestions for the whitelisting pop-up

I don't understand what the whitelisting box is telling me. For one, it scrunches up the left-side and right-side so I don't know what the full url's are. Additionally, I don't know what the left-hand and right-hand sections actually mean.

Could maybe on hover it show the full url string so I can read the whole line item? And can the left-side and right-side have descriptions above them so I know what this is telling me?

Huge CPU load

Hello,

With CleanLinks enabled, Firefox use a lot of CPU and so become slow and laggy.
Once I disable CleanLinks, the problem is gone.
Note, I use the default options.

I didn't make a lot of tests like disabling some options, identify some specific websites, or disabling some others incompatible add-ons.
If I have more detailed information I'll provide here.

Really good extension but not usable for me right now.

Thanks

Facebook's dirty links to external web pages not fully cleaned

Facebook seems to have recently taken additional steps to craftily embed tracking data into external links, which CleanLinks 3.2.1 doesn't remove. For example, here's the link Facebook has for a bbc.com web page before any cleaning at all:
https://l.facebook.com/l.php?u=https%3A%2F%2Fbbc.in%2F2D8dMwt%3Ffbclid%3DIwA......... [etc. etc., goes on for about 700 characters]
Obviously a job for CleanLinks, so I rightclick and do "Copy clean link," which gives this:
https://bbc.in/2D8dMwt?fbclid=IwAR1zDT_KSlH90LBrbPFKtdbfVVlRKo_pSPysgVVfzwif1WrILbteg-3rj8s
Clearly a big improvement, well done, but there's still tracking data following the question mark that hasn't been removed. I can pretty easily delete it manually which gives me this:
https://bbc.in/2D8dMwt
It'd be good if the next upgrade of CleanLinks would do that itself of course, as the extra data is presumably there to track me.
But there's more. If I paste the above (seemingly clean) link into the address bar and hit go, the link turns into this:
https://www.bbc.com/news/world-latin-america-45982501?ocid=socialflow_facebook&ns_source=facebook&ns_mchannel=social&ns_campaign=bbcnews
That's clearly not as clean as it looked. Doesn't seem like much to worry much about in terms of invading privacy, and I stand some chance of cleaning it myself by hitting the Escape key immediately after hitting go, and deleting from the right up to the question mark, to give this, which is the truly clean link I wanted from the start:
https://www.bbc.com/news/world-latin-america-45982501
After that I can hit go and the page opens fine. Naturally it's a cumbersome and not very reliable workaround. Like I say, the dirt seems fairly harmless anyway, but what bothers me is that Facebook now seems to have the potential to embed something more worrying than that if it ever decides to, and CleanLinks currently won't stop it.
By the way, congratulations on creating an otherwise excellent link cleaner. Best I've found so far :-)

Parse URL properly before cleaning

Cleaning is really applied to only a part to the link, which is URL.path, URL.search (and maybe URL).hash). Since some rules (e.g. whitelisting) apply per domain, it is useful to start from a properly parsed URL object.

Finding out the link is only (partly) tricky in the injected script, as when checking the header we have the full uri. The injected script is useful for visual feedback of cleaned links, but failing there will be caught later on if request cleaning is enabled.

Once that is done, it will be easy to allow per-domain rules, such as parameters to clean (see discussion #20) or some rules which are currently hardcoded (e.g. on google.com/search, don't clean if we find the URL in the parameter q=)

Whitelist selection ignored (?)

reproduce:
1. go: https://www.trojmiasto.pl/wiadomosci/Tak-powstaje-druga-kladka-na-Motlawie-n124071.html

2. try to open images from article (could be the first one)

3. results in internal non existing page

4. go back one page, whitelist latest entry

expected behavior:
clicking image will js zoom pic, or go to http pic location

what happens:
whitelist is ignored or regex to complex. no matter how many times its whitelisted we are back to internal non existing page.

Cleaning of URL tracking for Twitter embeds doesn't seem to work

CL remains unstoppable, whitelisting ignored

  1. go to https://audiosciencereview.com/forum/index.php and select register
  2. notice at Verification that validation box is not there
  3. whitelist:
    cbug
  4. refresh. w3 is not on in popup anymore but extension icon still displays „1” (not visible on screenshot below, sry). whitelisted entry is also missing from skipped domains in CL settings. CL is unstoppable, therefore on the page the validation box still not present
    cbug2
  5. disabling extension solves problem

Please extend the notification popup

Currently it only shows

Link cleaned!

URL

I would like it to show:

Page URL: https://blabla.com
Original URL: https://blabla.com/url=https://another.domain
Cleaned URL: https://another.domain

Page URL is required because processing might occur in a background tab/another Firefox window.

Re-evaluate CleanLinks default whitelisted domains and patterns

Skip Links Matching with
\/ServiceLogin|imgres\?|searchbyimage\?|watch%3Fv|auth\?client_id|signup|bing\.com\/widget|oauth|openid\.ns|\.mcstatic\.com|sVidLoc|[Ll]ogout|submit\?url=|magnet:|google\.com\/recaptcha\/


Remove from Links
(?:ref|aff)\\w*|utm_\\w+|(?:merchant|programme|media)ID

I'm not getting this regex to even work

I also like ClearURLs implementation of a mechanism to update the ruleset from github. And reviewing theirs we're clearly missing a ton.


Skip Domains
accounts.google.com,docs.google.com,translate.google.com,login.live.com,plus.google.com,twitter.com,static.ak.facebook.com,www.linkedin.com,www.virustotal.com,account.live.com,admin.brightcove.com,www.mywot.com,webcache.googleusercontent.com,web.archive.org,accounts.youtube.com,signin.ebay.com

Looking at Diego's commits these rules are all at least 4 years old. Sites change. I'd rather start with a clean slate and see what is applicable today.

Setting won't stick

As title.
Up-to-date Archlinux.
Firefox 60.0.1-1.
New profile with only CleanLinks installed.

Disqus "more comments" link doesn't work

small improvements for the log, popup, and whitelist

just a bunch of ideas:

whitelist:

  • if domain is already white listed prevent from creating duplicates

popup:

  • it's size is too big, does it really has to be that big? top info if necessary could be ¼ of it's size, leaving more for the log. no point of such big font too i guess.
  • it doesn't scale right. on attachment you can see i can scroll the popup ifself (about 5px)
    clog
  • signify clearly when link tracking is disabled (e.g. grey out list)
  • clear list button as suggested by jawz101

log:

  • option to view cleaned links per currently viewed domain tab – not all work it has done so far. switch could be in settings, or on the opposite site of „Whitelist Selection button”

Remove "page cleaning" mode

Right now there is a mode for CleanLinks (disabled by default) which cleans up all links preventively in a page, as opposed to handling this in the onClick handler. It's not named anywhere, it's just whenever "event delegation mode" is disabled.

It's less efficient for a handful of reasons:

  • It does unnecessary work for links that won't be clicked
  • It doesn't catch all links, when trackers are inserted in javacsript. "Repeat delay" is an ugly hackish attempt at fixing this and links in pages loaded in frames or by XHR.
  • Even with the repeat delay, some links slip through the cracks, see any google search page for example where links are clean until onmousedown when they are replaced with the link
  • Even if perfect, we'd still need the onClick handler to notify about cleaned links.

I only see one upside:

  • You can visually see all links that were potentially tracking you on the page and their count on the icon.

In light of this I'm thinking of removing this feature to simplify the code. Then we can even use the count on the icon as the total of cleaned links in the current session.

Does anyone use this page-cleaning feature? If so, am I missing something? Does it do something the event-delegation mode can not?

when putting cleanlinks in firefoxs overflow menu it isnt displayed completely

i have a 1280x800 screen and it isnt enough to display the whole addon because the overflow menu reduces the addons width and has no overflow scroll bars. it might be more of a problem on mozillas side but maybe some of the text could be put in a collapsible container or a tooltip to accommodate those shortcomings.

Redirect loop when visiting Amazon AWS

When visiting console.aws.amazon.com

This addon creates a redirect loop between

  • signin.aws.amazon.com
  • console.aws.amazon.com
  • us-east-1.aws.amazon.com

After a few seconds Firefox abandons charging the page
image

I have isolated the issue by doing a clean install of Firefox with only the CleanLinks addon, Aws works without CleanLinks, and fails with CleanLinks.

Whitelisting signin.aws.amazon.com solves the issue

Can't open links in new tab

While using extension it's not possible to open links in new tab when using keyboard shortcut Cmd/Ctrl + link. Reproducible on google.com.

Handle ports in hostnames

Either have host:port separately whitelistable from host, or have them both be allowed by a host whitelist entry.

all settings fields are now empty and cannot be edited...parsing bug

Adding |?Expires to the end of the default "Skip Links matching with:" field will render all fields unviewable and uneditable.

I'm using Win FF 56.0.2 Nightly.

I added that exception because Clean Links was scrubbing time-limited media links and this addition should fix the filtering, however it broke the display.

So, how can this be fixed?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.