HWM Hidden Clans

HWM Mod - Создаёт спойлер для списка кланов на странице игрока

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name 		HWM Hidden Clans
// @version 	1.1
// @description 	HWM Mod - Создаёт спойлер для списка кланов на странице игрока
// @author 	СтепнойВарварка
// @namespace 	mod Mefistophel_Gr
// @homepage 	https://greasyfork.org/ru/users/9016-Mefistophel-Gr
// @include 	http://*heroeswm.ru/pl_info.php*
// @include 	http://178.248.235.15/pl_info.php*
// @include 	http://*.lordswm.com/pl_info.php*
// @grant		none
// ==/UserScript==


(function() {
    var hide_clans = false;
    
    var b = document.querySelector('td.wb>a[href*="clan_info.php?id="]>b');
    
    if (b) {
        var td = b.parentNode.parentNode; td.style.display = 'none';
        td.parentNode.previousSibling.addEventListener('click', expandClans);
    }

    function expandClans() {
        if (hide_clans) {
            td.style.display = 'none';
        } else {
            td.style.display = '';
        }
        hide_clans = !hide_clans;
    }

})();