Skip to content

Instantly share code, notes, and snippets.

@fluks
Last active November 1, 2020 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save fluks/8a16cb189868401aba1968bf5feb4550 to your computer and use it in GitHub Desktop.
Save fluks/8a16cb189868401aba1968bf5feb4550 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