RCD-Torn2

Remove Crimes 2.0 Description Torn

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==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);
})();