UNWATERIFY ++

unwaters your island + anti-balloon

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

You will need to install an extension such as Tampermonkey to install this 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!)

Advertisement:

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

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 });
})();