chaturbateclean

chaturbate cleaner

От 04.12.2014. Виж последната версия.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey, Greasemonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да инсталирате разширение, като например Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Violentmonkey.

За да инсталирате този скрипт, трябва да имате инсталирано разширение като Tampermonkey или Userscripts.

За да инсталирате скрипта, трябва да инсталирате разширение като Tampermonkey.

За да инсталирате този скрипт, трябва да имате инсталиран скриптов мениджър.

(Вече имам скриптов мениджър, искам да го инсталирам!)

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да инсталирате разширение като Stylus.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

За да инсталирате този стил, трябва да имате инсталиран мениджър на потребителски стилове.

(Вече имам инсталиран мениджър на стиловете, искам да го инсталирам!)

// ==UserScript==
// @name           chaturbateclean
// @version 1.0
// @namespace      chaturbate_goes_ladroop
// @description    chaturbate cleaner
// @include        https://chaturbate.com/*
// @include        https://*.chaturbate.com/*
// @exclude	       http://serve.ads.chaturbate.com/*
// @grant          none
// @run-at         document-start
// ==/UserScript==

	version = 1.0;

// to skip agree screen
	createCookie("agreeterms","1",30);
// this cookie removes most add's
	if (!readCookie("noads")){createCookie("noads","1",30);window.location.reload(true)}
// notice and rotating add
	createCookie("np3","0",1);
	createCookie("dsmn49","1",1);
	createCookie("dsmn50","1",1);
	createCookie("dsmn51","1",1);
	createCookie("dsmn52","1",1);

function do_script() {

// use unused add space
	ad = document.getElementsByClassName('ad');
	verstr='<strong>Chaturbate clean V1.0 Made by Ladroop</strong><br> ';
	if (ad[0]){ad[0].innerHTML=verstr}

// advert options on menu bars - only save "main", "broadcast", "tags" and "my collection"
	bar=document.getElementById("nav");
	if (bar){
	barl=bar.getElementsByTagName('li');
	i=barl.length-1;
	while (i != -1){
	d=barl[i].innerHTML;
	if ((d.indexOf('/login') != -1)||(d.indexOf('href="/"') != -1)||(d.indexOf('href="/b/') != -1)||(d.indexOf('/my_') != -1)||(d.indexOf('/tags') != -1)){i--}
	else{barl[i].parentNode.removeChild(barl[i]);i--}
	}}

// blog spam
	ad = document.getElementsByClassName('featured_blog_posts')[0];
	if (ad){ad.parentNode.removeChild(ad)}

// footer spam
	ad = document.getElementsByClassName('featured_text')[0];
	if (ad){ad.parentNode.removeChild(ad)}

// announcement banner (if present)
	ad = document.getElementsByClassName('top-section')[0];
	if (ad){
	ad = ad.getElementsByTagName('img')[0];
	if (ad){ad.parentNode.removeChild(ad)}}

// advanced search
	if((document.location.href.indexOf("spy-on-cams")==-1)&&(document.location.href.indexOf("followed-cams")==-1)){
	if (document.getElementsByClassName('c-1 endless_page_template')[0]){
		if (document.getElementsByClassName('sub-nav')[0]){
		newli=document.createElement('li');
		data='<form><select onchange=\'loc=document.location.href.split("/");pos=loc[0]+"/"+loc[1]+"/"+loc[2]+this.options[this.selectedIndex].value;document.location.href=pos;\' style="margin: 0px 0px 0px 0px; background: #DDE9F5; color:#5E81A4; border-radius: 4px 4px 0px 0px;padding: 3px 1px 4px 12px; font-weight: 400; font-size: 13px; font-family: \'UbuntuMedium\',Arial,Helvetica,sans-serif;" >'
		+'<option value="/XX-cams">ALL CAMS IN CATEGORY</option>'
		+'<option value="/exhibitionist-cams/XX">EXHIBITIONIST CAMS</option>'
		+'<option value="/hd-cams/XX">HD CAMS</option>'
		+'<option value="/teen-cams/XX">TEEN CAMS (18+)</option>'
		+'<option value="/18to21-cams/XX">18 TO 21 CAMS</option>'
		+'<option value="/21to35-cams/XX">21 TO 35 CAMS</option>'
		+'<option value="/30to50-cams/XX">30 TO 50 CAMS</option>'
		+'<option value="/mature-cams/XX">MATURE CAMS (50+)</option>'
		+'<option value="/north-american-cams/XX">NORTH AMERICAN CAMS</option>'
		+'<option value="/euro-russian-cams/XX">EURO RUSSIAN CAMS</option>'
		+'<option value="/south-american-cams/XX">SOUTH AMERICAN CAMS</option>'
		+'<option value="/philippines-cams/XX">PHILIPPINES CAMS</option>'
		+'<option value="/asian-cams/XX">ASIAN CAMS</option>'
		+'<option value="/other-region-cams/XX">OTHER REGION CAMS</option>'
		+'<option value="/6-tokens-per-minute-private-cams/XX">6 TOKENS PER MINUTE</option>'
		+'<option value="/12-tokens-per-minute-private-cams/XX">12 TOKENS PER MINUTE</option>'
		+'<option value="/18-tokens-per-minute-private-cams/XX">18 TOKENS PER MINUTE</option>'
		+'<option value="/30-tokens-per-minute-private-cams/XX">30 TOKENS PER MINUTE</option>'
		+'<option value="/60-tokens-per-minute-private-cams/XX">60 TOKENS PER MINUTE</option>'
		+'<option value="/90-tokens-per-minute-private-cams/XX">90 TOKENS PER MINUTE</option>'
		+'</select></form>';
		uloc=document.location.href+"//////";
		loc=uloc.split("/");
		check=loc[3]+loc[4];
		gen="";
		if(check.indexOf("male") != -1){gen="male"}
		if(check.indexOf("female") != -1){gen="female"}
		if(check.indexOf("couple") != -1){gen="couple"}
		if(check.indexOf("transsexual") != -1){gen="transsexual"}
		re=/XX/gi
		data=data.replace(re,gen);
		if (gen == ""){data=data.replace("-cams","")}
		data=data.replace('<option value="/'+loc[3],'<option selected value="/'+loc[3])
		newli.innerHTML=data;
		tabs=document.getElementsByClassName('sub-nav')[0].getElementsByTagName("li");
		if (loc[4]!=""){
			for (n=0; n<tabs.length-1; n++){
				tabs[n].className="";
				if (tabs[n].getElementsByTagName("a")[0].href.indexOf(loc[4])!=-1){
					tabs[n].className="active";
				}
			}
		}
		document.getElementsByClassName('sub-nav')[0].appendChild(newli);
	}}}


// remove out of position images on profiles
	container = document.getElementById("tabs_content_container")
	if (container){
	var taglist=new Array("a","p","i","strong","b","u","ul","ol","li","h1","h2","h3","img","font","br");
	for (n=0; n<taglist.length-1; n++){
	blockelm (taglist[n]);
	}}

// remove lock pictures from thumbs on profiles
	pictures = document.getElementsByClassName('preview');
	if (pictures){
	for (i=0; i<pictures.length; i++){
	if(pictures[i].getAttribute("alt") =="Locked"){
	pictures[i].parentNode.removeChild(pictures[i]);
	}}}

//fix external links redirection
	var link = document.getElementsByTagName('a');
	for (i=0; i<link.length; i++){
	if (link[i].href.indexOf('?url=') != -1){
	linkhref=unescape(link[i].href);
	newlinkhref=linkhref.substring(linkhref.indexOf("?url=")+5,linkhref.indexOf("&domain"));
	link[i].href=newlinkhref;
	}}
	
}//end main

// to remove floating images on profile
	function blockelm(tag){
	var image = container.getElementsByTagName(tag);
	for (i=0; i<image.length; i++){
	if (image[i].style.position){
	if ((image[i].style.position.indexOf("absolute")!=-1)||(image[i].style.position.indexOf("fixed")!=-1)){
	image[i].style.display="none";
	}}}}


// cookie functions
	function createCookie(name,value,days,domain){
	if (domain){
	var domain=";domain=."+domain;
	}else var domain = "";
	if (days) {
	var date = new Date();
	date.setTime(date.getTime()+(days*24*60*60*1000));
	var expires = "; expires="+date.toGMTString();
	}else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/"+domain;
	}

	function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
	var c = ca[i];
	while (c.charAt(0)==' ') c = c.substring(1,c.length);
	if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
	}

window.addEventListener("DOMContentLoaded", function() { do_script() }, false);

//.user.js