Google click-tracking disabler

By Donny Viszneki Last update Mar 27, 2008 — Installed 5,889 times. Daily Installs: 8, 7, 6, 3, 13, 5, 5, 541, 170, 144, 49, 38, 50, 26, 130, 91, 40, 47, 25, 34, 35, 21, 23, 27, 31, 20, 24, 16, 18, 18, 15, 21
// ==UserScript==
// @name           Google click-tracking disabler
// @namespace      codebad.com
// @description    Google monitors which search results you click -- protect your privacy!
// @include        http://www.google.com/search*
// ==/UserScript==

// A test for whether or not an object is a DOM node that can contain other DOM nodes
var domlist = document.body.childNodes.constructor;
function fertile(o) { return (o.childNodes || false) && (o.constructor == domlist); }

// A simple string test we'll be using
if (String.prototype.beginsWith) {
    console.warn('googleclicktrackingdisab.user.js warning: String.prototype.beginsWith() has already been defined');
} else {
    String.prototype.beginsWith = function(s) {return this.slice(0, s.length) == s; }
}

Array.prototype.forEach.call(document.getElementsByTagName('a'), function(el) {
    var s = el.getAttribute('onmousedown');
    if (('string' == typeof s) && (s.beginsWith('return rwt(this,')))
        el.removeAttribute('onmousedown');
});