Planetsuzy Threads - Hide images in signatures

This script will automatically hide all images in signatures under each forum post

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @namespace Planetsuzy
// @name Planetsuzy Threads - Hide images in signatures
// @description This script will automatically hide all images in signatures under each forum post
// @version 1.0
// @license MIT
// @icon http://ps.fscache.com/styles/style1/images/statusicon/forum_old.gif
// @include /^https?://(www\.)?planetsuzy\.org/showthread\.php/
// @include /^https?:\/\/(www\.)?planetsuzy\.org\/t\d+[\w-]+\.html$/
// ==/UserScript==

const decoratePosts = function() {
  
  document.querySelectorAll('table[id^=post] [id^=td_post_]')
    .forEach(function (el) {
      let sigContext = false;
      for (let i = el.childNodes.length - 1; i >= 0; i--) {
        let node = el.childNodes[i];
        if (node.nodeType === Node.COMMENT_NODE && node.textContent.trim() === '/ sig') {
          sigContext = true;
        } else if (node.nodeType === Node.COMMENT_NODE && node.textContent.trim() === 'sig') {
          sigContext = false;
        } else if (sigContext && typeof node.querySelectorAll === 'function') {
          node.querySelectorAll('img')
            .forEach(function (img) {
              img.style.display = 'none';
            });
        }
      }
    });
};


decoratePosts();