Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masterchop/7736a7b1d3a4a355411c4a304ccc6275 to your computer and use it in GitHub Desktop.
Save masterchop/7736a7b1d3a4a355411c4a304ccc6275 to your computer and use it in GitHub Desktop.
Userscript for removing redirection and tracking(?) data from Google search results
// ==UserScript==
// @name Remove Google Redirect And Tracking From Search Results
// @description Userscript for removing redirection and tracking(?) data from Google search results.
// @version 1
// @author fluks
// @include https://*.google.*/search?*
// ==/UserScript==
document.querySelectorAll('h3.r > a')
.forEach(e => {
let u = e.href;
u = u.replace(/^.*?url\?q=/, '');
u = u.replace(/&.*$/, '');
e.href = decodeURIComponent(u);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment