Auto version of working bookmarklet (no reload needed)
// ==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);
});
}
})();