Pardus Shadowban - Chat

Hide chat messages from blocked users in Pardus chat

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 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!)

Advertisement:

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!)

Advertisement:

// ==UserScript==
// @name         Pardus Shadowban - Chat
// @license MIT
// @namespace    http://tampermonkey.net/
// @version      1
// @description  Hide chat messages from blocked users in Pardus chat
// @author       Solarix
// @match        https://chat.pardus.at/chattext.php?channel=*&uni=*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const blockedUsers = ['Jinx', 'Hired Gun', 'InsertNameHere']; // Add usernames here

    function cleanChat() {
        const lines = document.querySelectorAll('div');
        lines.forEach(line => {
            const senderLink = line.querySelector("a[href^=\"javascript:sendmsg('\"]");
            if (senderLink) {
                const match = senderLink.getAttribute('href').match(/sendmsg\('([^']+)'\)/);
                if (match && blockedUsers.includes(match[1])) {
                    line.remove();
                }
            }
        });
    }

    // Run on initial load
    cleanChat();

    // Continuously monitor for new messages
    const observer = new MutationObserver(cleanChat);
    observer.observe(document.body, { childList: true, subtree: true });
})();