RCD-Torn2

Remove Crimes 2.0 Description Torn

คุณจะต้องติดตั้งส่วนขยาย เช่น 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.

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         RCD-Torn2
// @namespace    **Imperatriz[2683794]**
// @version      1.1
// @description  Remove Crimes 2.0 Description Torn
// @match        https://www.torn.com/loader.php?sid=crimes*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const targetNode = document.querySelector("div.crimes-app");
    const observerConfig = { childList: true, subtree: true };
    const observer = new MutationObserver(async (mutationsList, observer) => {
        for (const mutation of mutationsList) {
            let mutationTarget = mutation.target;

            if (mutation.type === 'childList' && mutationTarget.classList.contains('arrowButton___gYTVW')) {
                $("div.currentCrime___KNKYQ").on("click", "div.topSection___HchKK div.crimeBanner___LiKtj div.crimeSliderArrowButtons___N_y4N button.arrowButton___gYTVW", function(){
                    observer.disconnect();
                    setTimeout(function(){
                        observer.observe(targetNode, observerConfig);
                    }, 800);
                });
            }

            if (mutation.type === 'childList' && mutationTarget.classList.contains('outcomePanel___yyL3R')) {
                mutationTarget.style.height = '100px';
                let outcomeDiv = mutationTarget.querySelector('div.outcome___Tnb4M');
                let storyp = mutationTarget.querySelector('p.story___GmRvQ');

                if (outcomeDiv == null || outcomeDiv.hasAttribute('data-value-set')) {
                    continue;
                }

                outcomeDiv.setAttribute('data-value-set', '');
                storyp.innerText = '';
            }
        }
    });

    observer.observe(targetNode, observerConfig);
})();