Toggle Labyrinth Ping

Adds a menu button to toggle the 'Labryinth Ping' badge.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Toggle Labyrinth Ping
// @namespace    https://www.milkywayidle.com/
// @version      1.2
// @description  Adds a menu button to toggle the 'Labryinth Ping' badge.
// @author       SilkyPanda
// @match        *://www.milkywayidle.com/*
// @match        *://milkywayidle.com/*
// @match        https://test.milkywayidle.com/*
// @icon         https://www.milkywayidle.com/favicon.svg
// @grant        GM_registerMenuCommand
// @grant        GM_setValue
// @grant        GM_getValue
// @grant        GM_addStyle
// @license      MIT
// ==/UserScript==


(function() {
    'use strict';

    let isDisabled = GM_getValue("disableLabyrinthPing", true);
    const styleId = "labyrinth-ping-remover-style";

    // CSS Logic: specifically targets the Labyrinth bar using the aria-label from the SVG
    const updateCSS = () => {
        let styleElement = document.getElementById(styleId);
        if (isDisabled) {
            if (!styleElement) {
                const style = document.createElement('style');
                style.id = styleId;

                style.innerHTML = `
                    .NavigationBar_nav__3uuUl:has(svg[aria-label="navigationBar.labyrinth"]) .NavigationBar_badge__3I_xZ {
                        display: none !important;
                    }
                `;
                document.head.appendChild(style);
            }
        } else {
            if (styleElement) {
                styleElement.remove();
            }
        }
    };

    GM_registerMenuCommand("Toggle Disable Labyrinth Ping", () => {
        isDisabled = !isDisabled;
        GM_setValue("disableLabyrinthPing", isDisabled);

        updateCSS();

    });

    updateCSS();

})();