Reddit Cleaner

Auto version of working bookmarklet (no reload needed)

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         Reddit Cleaner
// @namespace    https://greasyfork.org/users/aakash-yadav
// @version      2.0
// @description  Auto version of working bookmarklet (no reload needed)
// @author       graphite
// @match        https://www.reddit.com/*
// @run-at       document-end
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    function unblock() {
        try {
            // Reset body lock
            document.body.style = "";

            // Remove blur layer
            document.querySelector("div[style*='blur(4px)']")?.remove();

            // Remove main modal
            document.getElementById("blocking-modal")?.remove();

            // Remove shadow popup
            try {
                const x = document.getElementsByTagName("xpromo-nsfw-blocking-container")[0];
                if (x && x.shadowRoot && x.shadowRoot.children[1]) {
                    x.shadowRoot.children[1].remove();
                }
            } catch(e) {}

            // Remove other popups
            document.getElementsByTagName("xpromo-untagged-content-blocking-modal")[0]?.remove();
            document.querySelector("shreddit-exit-app-modal")?.remove();

        } catch(e) {}
    }

    // Run immediately on load
    unblock();

    // Keep running for dynamic content
    setInterval(unblock, 800);

    // Re-run on Reddit SPA navigation (page changes without reload)
    if (window.navigation) {
        window.navigation.addEventListener("navigate", () => {
            unblock();
            setTimeout(unblock, 500);
            setTimeout(unblock, 1500);
            setTimeout(unblock, 3000);
        });
    }

})();