Torn - Disable Booster Tab

Makes the Booster tab appear and behave as disabled on the item page.

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 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         Torn - Disable Booster Tab
// @namespace    gin4
// @version      1.1
// @description  Makes the Booster tab appear and behave as disabled on the item page.
// @match        https://www.torn.com/item.php*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const disableBoosterTab = (tab) => {
        if (!tab || tab.classList.contains('ui-state-disabled')) return;

        // Add Torn's disabled classes
        tab.classList.add('ui-state-disabled', 'no-items');
        tab.setAttribute('aria-disabled', 'true');
        tab.setAttribute('aria-selected', 'false');
        tab.setAttribute('tabindex', '-1');

        // Remove active/selected state if present
        tab.classList.remove('ui-tabs-active', 'ui-state-active');
        tab.removeAttribute('aria-controls');

        // Disable its link
        const link = tab.querySelector('a');
        if (link) {
            link.removeAttribute('href');
            link.removeAttribute('tabindex');
            link.style.pointerEvents = 'none';
            link.title = 'Disabled';
        }
    };

    // Observe the DOM since Torn loads tabs dynamically
    const observer = new MutationObserver(() => {
        const boosterTab = document.querySelector('li#categoriesItem[data-type="Booster"]');
        if (boosterTab) {
            disableBoosterTab(boosterTab);
            observer.disconnect();
        }
    });

    observer.observe(document.body, { childList: true, subtree: true });
})();