Skip to content

Instantly share code, notes, and snippets.

@luikore
Created January 18, 2012 05:06
Show Gist options
  • Save luikore/1631089 to your computer and use it in GitHub Desktop.
Save luikore/1631089 to your computer and use it in GitHub Desktop.
Stop google tracking search click with redirect
// ==UserScript==
// @match https://www.google.com/*
// ==/UserScript==
interval = 400
clean = function(){
console.log('cleaning')
var links = document.querySelectorAll('#search h3 a')
var i
for(i=0; i<links.length; i++){
var link = links[i]
link.removeAttribute('onmousedown')
var u = link.href.match(/\&url=(.*?)(?:\&|$)/)
if(u)
link.href = decodeURIComponent(u[1])
}
interval *= 2
setTimeout(clean, interval)
}
setTimeout(clean, interval)

Use: drag clean_url.user.js onto chrome.

NOTE: doing this in a plugin won't work. Plugin script executes in a different javascript context and can't fight against real script.

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