UNWATERIFY ++

unwaters your island + anti-balloon

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

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.

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

Advertisement:

// ==UserScript==
// @name         UNWATERIFY ++
// @namespace    http://tampermonkey.net
// @version      0.2.2
// @author       morilog
// @license MIT
// @description  unwaters your island + anti-balloon
// @match        https://summer.hackclub.com/*
// @run-at       document-start
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const badClasses = [
        'floating-balloon-container',
        'sinkening-water',
        'sinkening-water-2'
    ];

    function yeetMatchingStuff() {
        // yeet water-rock styles
        document.querySelectorAll('style').forEach(styleEl => {
            if (styleEl.textContent.includes('@keyframes water-rock')) {
                console.log('🗑 yeeting style block with water-rock');
                styleEl.remove();
            }
        });

        // yeet sinkening-wave-music
        const waveMusic = document.getElementById('sinkening-wave-music');
        if (waveMusic) {
            console.log('🗑 yeeting sinkening-wave-music');
            waveMusic.remove();
        }

        // yeet bad classes
        badClasses.forEach(cls => {
            document.querySelectorAll(`.${cls}`).forEach(el => {
                console.log(`💥 yeeting .${cls}`);
                el.remove();
            });
        });
    }

    yeetMatchingStuff();

    const observer = new MutationObserver(muts => {
        for (const mut of muts) {
            for (const node of mut.addedNodes) {
                if (node.nodeType !== Node.ELEMENT_NODE) continue;

                // dynamic water-rock styles
                if (node.tagName === 'STYLE' && node.textContent.includes('@keyframes water-rock')) {
                    console.log('🗑 caught dynamic water-rock, yeeting');
                    node.remove();
                }

                // dynamic sinkening-wave-music
                if (node.id === 'sinkening-wave-music') {
                    console.log('🗑 caught dynamic sinkening-wave-music, yeeting');
                    node.remove();
                }

                // dynamic bad classes
                if (node.classList) {
                    badClasses.forEach(cls => {
                        if (node.classList.contains(cls)) {
                            console.log(`💥 caught dynamic .${cls}, yeeting`);
                            node.remove();
                        }
                    });
                }

                // just in case they're nested
                if (node.querySelectorAll) {
                    const selector = ['#sinkening-wave-music']
                        .concat(badClasses.map(c => `.${c}`))
                        .join(', ');
                    node.querySelectorAll(selector).forEach(el => {
                        console.log('🗑💥 yeeting nested bad element');
                        el.remove();
                    });
                }
            }
        }
    });

    observer.observe(document.documentElement, { childList: true, subtree: true });
})();