_@/ ft.com

By crazysnailboy Last update Apr 13, 2008 — Installed 229 times. Daily Installs: 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 1, 0
// ==UserScript==
// @name           _@/ ft.com
// @author         Chris Porter
// @version        0.1
// @date           2008-04-13
// @namespace      http://www.crazysnailboy.net/greasemonkey/
// @include        http://www.ft.com/*
// ==/UserScript==

document.removeElementsByXPath = function(sValue) { var a = this.evaluate(sValue,  ((arguments.lenth > 1) ? arguments[1] : this), null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for ( var i = 0 ; i < a.snapshotLength ; i++ ) { a.snapshotItem(i).parentNode.removeChild(a.snapshotItem(i)); } };


// =================================================================================================
// FT
// -------------------------------------------------------------------------------------------------
//
//
// =================================================================================================

var FT = (function(){


// -------------------------------------------------------------------------------------------------
// removeAds

this.removeAds =
	function()
	{
	var a = [];
	a.push("//div[@id='page-header-ad']");
	for ( var i = 0 ; i < a.length ; i++ ) { document.removeElementsByXPath(a[i]); }
	};


// -------------------------------------------------------------------------------------------------
// bypassAuthorisation

this.bypassAuthorisation =
	function()
	{
	var s = location.href;
	if (s.indexOf("Authorised=false") > 0)
		{
		s = s.replace("Authorised=false", "Authorised=true");
		location.href = s;
		return true;
		}
	return false;
	};


// ---------------------------------------------------------------------------------------------
// onCreate

this.onCreate =
	function()
	{
	if (this.bypassAuthorisation()) return;
	this.removeAds();
	};


this.onCreate();
})();