Hotspot Shield ad remove

By nox.freak Last update Aug 17, 2009 — Installed 4,170 times. Daily Installs: 31, 12, 37, 31, 34, 31, 24, 25, 20, 27, 22, 26, 16, 40, 8, 31, 26, 23, 10, 24, 25, 39, 15, 23, 27, 33, 19, 27, 22, 19, 25, 17

There are 3 previous versions of this script.

// ==UserScript==
// @name           Hotspot Shield ad remove
// @namespace      
// @description    Removes Hotspot Shield's Ad banner from every page.
// @include        http://*
// @include        https://*
// @include        file:*
// @copyright      Winter Faulk
// @version        1.2
// @license        Creative Commons Attribution-Noncommercial 3.0 United States License
// ==/UserScript==

// Thanks to Leo Janeway (http://userscripts.org/users/64553) for some changes/fixes

function remove_ad()
{
	var allDIVTags = new Array();
	var allDIVTags=document.getElementsByTagName("div");
	
	var pattern1 = new RegExp("(^[a-zA-Z]{1,4}[0-9]{1,3}$)");
	var pattern2 = new RegExp("(^[a-zA-Z]{1,3}_\a\l\l[0-9]{1,3}$)");
	for (i=0; i<allDIVTags.length; i++)
	{
		if (pattern1.test(allDIVTags[i].id) && allDIVTags[i].style.display != "none" && pattern2.test(allDIVTags[i].className))
		{
			allDIVTags[i].parentNode.removeChild(allDIVTags[i]);
			document.getElementsByTagName('html')[0].style.marginTop='0';
			i = allDIVTags.length+1
			return true;
		}
	}
	return false;
}

remove_ad();