zmien pasek

zmien

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name       zmien pasek
// @namespace  https://www.wykop.pl/*
// @version    1.0
// @description zmien
// @include     *://www.wykop.pl/*
// @copyright  Arkatch
// ==/UserScript==

function setSex(nick){
	let x = document.querySelectorAll('a.profile[href="https://www.wykop.pl/ludzie/'+nick+'/"] > img');
	for(let elem of x)
	elem.setAttribute('class', 'avatar female lazy');
}
function loaded(){
	setSex('mgnfic');
}
function reloadAvatar(){
	return new Promise((resolve, reject)=>{
		setTimeout(()=>{
			resolve();
		}, 600);
	}).then(()=>{
		loaded();
	});
}
function eventList(){
	let x = document.querySelectorAll('.more > a.affect.ajax');
	for(let i of x){
		i.addEventListener('click', reloadAvatar, false);
	}
}
{
	document.onreadystatechange = ()=>{
		let s = document.readyState;
		if(s === "interactive" || s === "complete") {
			loaded();
			eventList();
		}
	};
}