CtgoFX

Remove ads and white spaces from chatango

Versione datata 25/10/2014. Vedi la nuova versione l'ultima versione.

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name        CtgoFX
// @author      Itsuki
// @version     120614-3
// @include     http://*.chatango.com*
// @grant       GM_addStyle
// @namespace https://greasyfork.org/users/6316
// @description Remove ads and white spaces from chatango
// ==/UserScript==

GM_addStyle (' \
	#ad, #ad_placeholder_td, #ad_wrapper, \
	#buyers_ad, #bottom_table, \
	* body [name*='google_ads_frame1'], \
	* body [name*='google_ads_frame2'], \
	#left_container [href*='ad'], .topad { \
		display: none !important; \
		visibility: hidden !important; \
	} \
	#flashcontent{ \
		display:block !important; \
		position:absolute !important; \
		top:0px; \
		left:0px; \
		width:100%; \
		height:100%; \
	}');

function styleElement (obj, styles) {
	for (var property in styles) {
		if (styles.hasOwnProperty(property)) obj.style[property] = styles[property];
	}
}

function fixPage() {
	document.getElementsByTagName("col")[1].style.display = 'none';
	document.getElementsByTagName("colgroup")[0].style.display = 'none';
	styleElement(bottom_table, {display: "none", visibility: "hidden"});
}

function removeAdSection() {
	styleElement(ad, {display: "none", visibility: "hidden"});
	styleElement(ad_placeholder_td, {display: "none", visibility: "hidden"});
	styleElement(ad_wrapper, {display: "none", visibility: "hidden"});
	styleElement(buyers_ad, {display: "none", visibility: "hidden"});
	styleElement(topad, {display: "none", visibility: "hidden"});
}

try {
	fixPage();
	removeAdSection();
} catch(err) {}