// ==UserScript==
// @name           Blackspot Google Randomly
// @namespace      http://www.adbusters.org/blogs/blackspot_blog/unclick_google.html
// @description    Randomly clicks on Google ads as protest against privacy violations -- based on Prefetch Google Ads by Alf at http://hublog.hubmed.org

// @include        http://*
// ==/UserScript==

window.addEventListener("load", function(e) {

    var a = document.evaluate("//a[contains(@href,'aclk')]", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
    var x, i;
    var n = new Array();
    for (i = 0; x = a.snapshotItem(i); i++) { n.push(x); }
    var l = n.length;
    if (!l) return;
    var r = Math.round(Math.random()*(l-1));
    var link = n[r].href;
    window.setTimeout(
        function(){
            GM_xmlhttpRequest({
                method: "GET",
                url: link,
                headers: {
                  'Referer': document.location
                }
            });
        }
    ,Math.random()*20000);           
}, false);

