Hide sell skimmer button

Hide that pesky sell skimmer button

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Hide sell skimmer button
// @namespace    heasley.hide-skim-seller
// @version      1.0
// @description  Hide that pesky sell skimmer button
// @author       You
// @match        https://www.torn.com/loader.php?sid=crimes*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=torn.com
// @grant        none
// @license      MIT
// ==/UserScript==
const skim_observer = new MutationObserver(function(mutations) {
    const url = window.location.href;
    if (url.includes("sid=crimes") && url.includes("cardskimming")) {
        var sell_skim_row = $("[class*='crimeOptionSection_']:contains(Sell Card Details)");
        var sell_skim_button = sell_skim_row.parent().find("[class*='crimeOptionSection_'][class*='commitButtonSection_'] > button.commit-button");
    if (sell_skim_button.length && !sell_skim_button.hasClass("wb-hidden")) {
            sell_skim_button.hide().addClass("wb-hidden");
        }
    }
});


(function() {
    'use strict';

    skim_observer.observe(document, {attributes: false, childList: true, characterData: false, subtree:true});

})();