CleanChat

A script to clear all the errors in bloxd.io

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         CleanChat
// @namespace    http://tampermonkey.net/
// @version      2025-10-12
// @description  A script to clear all the errors in bloxd.io
// @author       Cvetocheckcactus (Цветочек Кактус)
// @match        https://bloxd.io/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=bloxd.io
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const badWords = ['internalerror', 's to run more code', 'apierror', 'last error of', 'logging too many errors', 'syntaxerror', 'not a function', 'evalerror'];
    const hiddenMessages = [];

    const observer = new MutationObserver((mutationsList) => {
        for (const mutation of mutationsList) {
            if (mutation.type === 'childList') {
                mutation.addedNodes.forEach(node => {
                    if (node.nodeType === 1) {
                        const text = node.textContent.toLowerCase();

                        if (badWords.some(word => text.includes(word))) {
                            node.style.transition = 'all 0.3s ease';
                            node.style.opacity = '0';
                            node.style.height = '0';
                            hiddenMessages.push(node);
                        }
                    }
                });
            }
        }
    });

    setInterval(() => {
        observer.disconnect();
        const chat = document.querySelector('.ChatMessages');
        if (chat) {
            observer.observe(chat, {
                childList: true,
                subtree: false
            });
        }
    }, 10000);

    let hiddenVisible = false;

    document.addEventListener('keydown', (e) => {
        if (e.key.toLowerCase() === 'h') {
            hiddenVisible = !hiddenVisible;

            hiddenMessages.forEach(msg => {
                if (hiddenVisible) {
                    msg.style.height = '20px';
                    msg.style.opacity = '0.5';
                } else {
                    msg.style.height = '0';
                    msg.style.opacity = '0';
                }
            });
        }
    });

})();