{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 // Adsense Prevent Accidental Clicks\par
// Version 1\par
// Copyright (C) 2005 Michael Hampton\par
// Released under the GNU General Public License\par
// http://www.ioerror.us/software/license/\par
\par
// ==UserScript==\par
// @name          Adsense Prevent Accidental Clicks\par
// @namespace     http://www.ioerror.us/software\par
// @description   Prevents you from accidentally clicking on your own Adsense ads\par
// @include       http://pagead2.googlesyndication.com/*\par
// ==/UserScript==\par
\par
(function() \{\par
\tab function get_publisher_id() \{\par
\tab\tab publisher = prompt("Which AdSense publisher ID should be blocked from accidental\\nclicks? This is the pub-**************** number, without quotes,\\nfrom your AdSense code. The publisher ID is currently set\\nto " + GM_getValue('publisher') + ".");\par
\tab\tab if (!publisher) \{\par
\tab\tab\tab publisher = GM_getValue('publisher', 'NONE');\par
\tab\tab\}\par
\tab\tab GM_setValue('publisher', publisher);\par
\tab\}\par
\tab\par
\tab if (!GM_getValue) \{\par
\tab\tab alert("Sorry, your version of Greasemonkey is too old. Please upgrade to\\nGreasemonkey version 0.5 or later.\\nhttp://greasemonkey.mozdev.org/");\par
\tab\tab return;\par
\tab\}\par
\tab\par
\tab GM_registerMenuCommand('Change AdSense Publisher ID', get_publisher_id);\par
\tab\par
\tab publisher = GM_getValue('publisher');\par
\tab if (!publisher) \{\par
\tab\tab get_publisher_id();\par
\tab\}\par
\par
\tab if (document.location.href.indexOf(publisher) > -1) \{\par
\tab\tab document.addEventListener('click', function(event) \{\par
\tab\tab\tab event.stopPropagation();\par
\tab\tab\tab event.preventDefault();\par
\tab\tab\}, true);\par
\tab\}\par
\})();\par
}
 
