Torn Combat Content Remover

Remove unwanted images and div elements in Torn combat page

بۇ قوليازمىنى قاچىلاش؟
ئاپتورنىڭ تەۋسىيەلىگەن قوليازمىسى

سىز بەلكىم TC Bootlegging Plus نى ياقتۇرۇشىڭىز مۇمكىن.

بۇ قوليازمىنى قاچىلاش

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 or Violentmonkey 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 Combat Content Remover
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Remove unwanted images and div elements in Torn combat page
// @author       ErrorNullTag
// @match        https://www.torn.com/loader.php?sid=attack&user2ID=*
// @grant        none
// @license      GPU GPLv3
// ==/UserScript==

(function() {
    'use strict';

    function removeUnwantedContent() {
        const unwantedElements = document.querySelectorAll('img[src^="/images/"], div[class*="model"]');

        for (let elem of unwantedElements) {
            elem.parentNode.removeChild(elem);
        }
    }

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