Skip to content

Instantly share code, notes, and snippets.

@keb
Created July 9, 2023 20:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keb/69005d2a4df0c6aa81f4423b309cfaf0 to your computer and use it in GitHub Desktop.
Save keb/69005d2a4df0c6aa81f4423b309cfaf0 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Remove tracking links on duckduckgo.com HTML version
// @namespace Violentmonkey Scripts
// @match https://html.duckduckgo.com/html/
// @grant none
// @version 1.0
// @author -
// @description 7/9/2023, 4:36:51 PM
// @run-at document-idle
// ==/UserScript==
let links = document.querySelectorAll('.result__a, .result__snippet, .result__url');
for (let i = 0; i < links.length; i++) {
let link = links[i];
let clean = link.href.replace(/^https:\/\/duckduckgo\.com\/l\/\?uddg=|&rut.*$/g, '');
link.href = decodeURIComponent(clean);
}
@sergeevabc
Copy link

Does it still work on your end, @keb? Looks like it needs an update.

@keb
Copy link
Author

keb commented Dec 7, 2023

@sergeevabc it seems to still work for me. reminder that this is only for the HTML version: https://html.duckduckgo.com/html/

I no longer use DDG for what it's worth (switched back to Google)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment