Cloacked links (Google chat and perhaps elsewhere)

Various discussions related to Adblock Plus development
Post Reply
Exceter
Posts: 3
Joined: Wed Feb 27, 2019 2:33 pm

Cloacked links (Google chat and perhaps elsewhere)

Post by Exceter »

I use google chat a lot both personally and professionally and I really dislike how Google rewrites the URL's that I send to family and colleagues. It's really nosy of them to track what links we click. It shouldn't be any of their business and I consider it to be a violation of our privacy. Here's a concrete example. I sent myself a link to the AdBlockPlus website from one of my other google accounts and what you see below is how Google constructed the hyperlink.

Code: Select all

<a rel="nofollow noreferrer noopener" target="_blank" href="https://www.google.com/url?q=https://adblockplus.org/&sa=D&source=hangouts&ust=1551362671051000&usg=AFQjCNEFySHczplshi84HQvqE_SctNnWrQ" class="Xx" tabindex="-1" dir="ltr" data-display="https://adblockplus.org/" data-sanitized="https://www.google.com/url?q=https://adblockplus.org/&sa=D&source=hangouts&ust=1551362671051000&usg=AFQjCNEFySHczplshi84HQvqE_SctNnWrQ">https://adblockplus.org/</a>
The original link has been rewritten from this: https://adblockplus.org/

To this: https://www.google.com/url?q=https://ad ... E_SctNnWrQ

Interestingly, Google doesn't do this for their own URL's. For example, if I share a youtube video in Google chat the URL does not get rewritten as can be seen here:

Code: Select all

<a rel="nofollow noreferrer noopener" target="_blank" href="https://www.youtube.com/watch?v=7ujgMjMnLd8" class="Xx" tabindex="-1" dir="ltr" data-display="https://www.youtube.com/watch?v=7ujgMjMnLd8" data-sanitized="https://www.youtube.com/watch?v=7ujgMjMnLd8">https://www.youtube.com/watch?v=7ujgMjMnLd8</a>
My proposal: When the hyperlink text is a url and the hyperlink text does not match the href attribute of the hyperlink then the href attribute of the hyperlink should be replaced with the hyperlink text. I'm willing to help develop this feature if there's any interest in it.
Exceter
Posts: 3
Joined: Wed Feb 27, 2019 2:33 pm

Re: Cloacked links (Google chat and perhaps elsewhere)

Post by Exceter »

They do the same thing, even if the URL appears in the middle of a sentence so my proposed detection method would still work unless they started putting additional text within the hyperlink label:

Code: Select all

<span id=":15b.co" class="tL8wMe EMoHub" style="text-align: left;" dir="ltr">This is <a rel="nofollow noreferrer noopener" target="_blank" href="https://www.google.com/url?q=https://adblockplus.org/&sa=D&source=hangouts&ust=1551363338597000&usg=AFQjCNHFS4o4QDRDwWberpX5sANoALUvKw" class="Xx" tabindex="-1" dir="ltr" data-display="https://adblockplus.org/" data-sanitized="https://www.google.com/url?q=https://adblockplus.org/&sa=D&source=hangouts&ust=1551363338597000&usg=AFQjCNHFS4o4QDRDwWberpX5sANoALUvKw">https://adblockplus.org/</a> a test</span>
Exceter
Posts: 3
Joined: Wed Feb 27, 2019 2:33 pm

Re: Cloacked links (Google chat and perhaps elsewhere)

Post by Exceter »

That's a great extension! Thanks! However, I would still prefer that this feature were part of AdBlock Plus. Is there a reason why it isn't?
User avatar
mapx
Posts: 21940
Joined: Thu Jan 06, 2011 2:01 pm

Re: Cloacked links (Google chat and perhaps elsewhere)

Post by mapx »

maybe it seems to be an easy task but in the end this code (or similar) should be integrated in adblocker (which has more general goals)
https://github.com/Rob--W/dont-track-me ... tscript.js
Post Reply