useless_buttons

Удаляет при просмотре боя кнопку `вернуться назад` и `вернуться на страницу героя`, в десктоп клиенте убирает кнопку `информация`

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

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

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

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

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         useless_buttons
// @namespace    http://tampermonkey.net/
// @version      0.1.3
// @description  Удаляет при просмотре боя кнопку `вернуться назад` и  `вернуться на страницу героя`, в десктоп клиенте убирает кнопку `информация`
// @author       Something begins
// @license      University of Sugma
// @match       https://www.heroeswm.ru/war*
// @match       https://my.lordswm.com/war*
// @match       https://www.lordswm.com/war*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant unsafeWindow
// ==/UserScript==

function observeDisplay(el){
    const observer = new MutationObserver((mutationsList) => {
        for (const mutation of mutationsList) {
            if (mutation.type === "attributes" && mutation.attributeName === "style" && el.style.display !== "none") {
                el.style.display = "none";
            }
        }
    });
    observer.observe(el, {
        attributes: true,
        attributeFilter: ["style"]
    });

}
const mobileInterval = setInterval(() => {
    if ([typeof android, typeof iOS].includes("undefined")) return;
    clearInterval(mobileInterval);
    const selectors = ["back_to_game", "back_to_home"];
    if (!android && !iOS) selectors.push("info_on");
    const buttonsLoadedInterval = setInterval(()=>{

        selectors.forEach(selector=>{
            const el = document.querySelector("#"+selector);
            if (el) {
                el.style.display = "none";
                observeDisplay(el);
                clearInterval(buttonsLoadedInterval);
            }
        })
    }, 100);
}, 100);