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.
// ==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) |