Torn Market Seller Blocker

Blocks specific sellers in the Torn item market

// ==UserScript==
// @name         Torn Market Seller Blocker
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Blocks specific sellers in the Torn item market
// @author       Weav3r
// @match        https://www.torn.com/page.php?sid=ItemMarket*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
  
    //Insert the userID of all users you want to block into the brackets below, comma separated. IE: [1234, 4321, 1423]
    const blockedIDs = [];

    function blockRow(row) {
        row.style.cssText = `
            opacity: 0.4;
            pointer-events: none;
            background-color: #444 !important;
            filter: grayscale(100%);
        `;
        row.querySelectorAll('button, input').forEach(el => el.disabled = true);
    }

    function checkRows() {
        document.querySelectorAll('.sellerRow___AI0m6').forEach(row => {
            const profileLink = row.querySelector('a[href*="profiles.php?XID="]');
            if (profileLink && blockedIDs.includes(parseInt(profileLink.href.match(/XID=(\d+)/)[1]))) {
                blockRow(row);
            }
        });
    }

    new MutationObserver(checkRows).observe(document, {
        childList: true,
        subtree: true
    });

    checkRows();
})();