Yahoo click-tracking disabler

By Donny Viszneki Last update Apr 28, 2008 — Installed 972 times. Daily Installs: 48, 18, 19, 28, 24, 17, 14, 14, 17, 8, 9, 5, 2, 3, 10, 1, 7, 6, 10, 8, 6, 6, 6, 3, 7, 4, 5, 5, 3, 2, 0, 4
// ==UserScript==
// @name           Yahoo click-tracking disabler
// @namespace      codebad.com
// @description    Disables performance- and privacy-impeding click tracking in Yahoo search results
// @include        http://search.yahoo.com/search*
// ==/UserScript==
(function(){

// 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; }
}

var r = new RegExp('%..'), 
    c = String.fromCharCode,
    f = function(s) {return c(parseInt(s.substr(1),16))}

Array.prototype.forEach.call(document.getElementsByTagName('a'), function(el) {
    var s = el.hostname;
    if (('string' == typeof s) && (s.beginsWith('rds.yahoo.'))) {
        var h = el.href;
        el.href = h.substr(h.search('\\*\\*')+2).replace(r,f);
    }
})

})()