IdleHacking - Cursor Cleanup

Keep normal text as arrow cursor while preserving pointer cursor on interactive game UI.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला 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 यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

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

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

Advertisement:

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

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

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

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

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

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

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

Advertisement:

// ==UserScript==
// @name         IdleHacking - Cursor Cleanup
// @namespace    https://greasyfork.org/
// @version      1.02
// @description  Keep normal text as arrow cursor while preserving pointer cursor on interactive game UI.
// @match        https://www.idlehacking.com/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==

(function () {
    'use strict';

    if (window.__idlehackingCursorCleanupInstalled) return;
    window.__idlehackingCursorCleanupInstalled = true;

    const STYLE_ID = 'idlehacking-cursor-cleanup-style';

    function installStyle() {
        if (document.getElementById(STYLE_ID)) return;

        const style = document.createElement('style');
        style.id = STYLE_ID;
        style.textContent = `
            /* Default everything non-editable to normal arrow */
            *:not(input):not(textarea):not(select):not(option):not(button):not(a):not([contenteditable="true"]) {
                cursor: default !important;
            }

            /* Preserve hand cursor on interactive elements */
            a,
            button,
            select,
            option,
            [role="button"],
            .panel-collapse-indicator,
            .panel-header-collapsible {
                cursor: pointer !important;
            }

            /* Keep text-entry controls behaving normally */
            input,
            textarea,
            [contenteditable="true"] {
                cursor: text !important;
            }
        `;

        document.head.appendChild(style);
    }

    function init() {
        if (!document.head) return;
        installStyle();
    }

    if (document.readyState === 'loading') {
        document.addEventListener('DOMContentLoaded', init, { once: true });
    } else {
        init();
    }

    window.__idlehackingCursorCleanupRemove = function () {
        const style = document.getElementById(STYLE_ID);
        if (style) style.remove();
        delete window.__idlehackingCursorCleanupInstalled;
        delete window.__idlehackingCursorCleanupRemove;
    };
})();