Rob--W / dont-track-me-google

Firefox and Chrome extensions to prevent Google from making links ugly.
MIT License
459 stars 26 forks source link

[Suggestion] YouTube support #38

Open Wxrlds opened 4 years ago

Wxrlds commented 4 years ago

When clicking a link in the description of any YouTube video, it first redirects you to youtube.com/redirect and from there to your desired location. As Google and YouTube belong together it's kind of useless preventing being tracked by google.com but when clicking a link through YouTube they still track you. It would be nice if this addon could also prevent YouTube from modifying links.

Rob--W commented 4 years ago

I looked at a random video with a link in the description (https://www.youtube.com/watch?v=y7h_B7UPaYI) and found the following example:

<a class="yt-simple-endpoint style-scope yt-formatted-string" spellcheck="false" href="/redirect?redir_token=[ some long base64-encoded string ]&amp;q=[ url-encoded absolute URL here ]&amp;v=[ video id ]&amp;event=video_description" rel="nofollow" target="_blank" dir="auto">[ absolute URL here ]</a>

I suppose that the logic from my extension is generic enough that it can work for YouTube, with some small modifications.

I'm not going to add this to my extension, however, because it requires a new extension permission (access to youtube). When a new permission is requested, Chrome disables the extension unil the permission change is explicitly approved (and Firefox pauses updates until explicitly approved). There are alternatives (optional permissions + dynamic content scripts), but that incurs some performance cost.

Links in YouTube descriptions are often not the real URLs anyway. They are often shortened links redirecting to the actual destination, loaded with trackers (affiliate links) to support the content creator who published the video.

hatkidchan commented 9 months ago

Can also be extended into removing &si=XXXXXXXX parameter when sharing it

1nikolas commented 7 months ago

Also there is the &pp= parameter when copying links from a search

ale5000-git commented 1 month ago

Look at this example, in the description of: https://www.youtube.com/watch?v=WyrpYUzcjtY there is this url: https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbXBTYWZhUmJnR3JIQzhDV2ZRN05aM2RSQTVCZ3xBQ3Jtc0tsOTA5bWZlVmhFVC03LW96VWlpZU9PVGU2VVh3dUtLaDNxdEJwei1JekowZy1UbnJsR0JUTzVwXzRpTlVPcGtGTDd3b0J4TEpzMzhpQ3pfUlhMZ2JPdE03anRnSHdHdVJzQTVvZUpPVFZXMkpSSk1pTQ&q=https%3A%2F%2Fgithub.com%2Fmicro5k%2Fmicrog-unofficial-installer%2Freleases%2Fdownload%2Fv1.3.1-beta%2Fmicrog-unofficial-installer-v1.3.1-beta-by-ale5000-OSS-signed.zip&v=WyrpYUzcjtY

Only the thing inside q= is the real URL, everything else can be discarded.