Reddit NSFW Media Unlocker (April 2026)

Stable Reddit NSFW unblocker (auto-updating DOM changes)

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         Reddit NSFW Media Unlocker (April 2026)
// @match        https://www.reddit.com/*
// @grant        none
// @run-at       document-start
// @version 0.0.1.20260417144048
// @namespace https://greasyfork.org/users/aakash-yadav
// @description Stable Reddit NSFW unblocker (auto-updating DOM changes)
// ==/UserScript==

(function() {
    'use strict';

    function fixReddit() {
        // 1. Force Scroll (Unfreezes the page)
        document.documentElement.style.overflow = 'auto';
        document.body.style.overflow = 'auto';

        // 2. Clear the full-screen app walls
        document.querySelectorAll('shreddit-experience-tree, shreddit-async-loader, #blocking-modal').forEach(el => el.remove());

        // 3. PIERCE SHADOW DOM (Fixes the text & black screen in your screenshots)
        document.querySelectorAll('shreddit-blurred-container, xpromo-nsfw-blocking-container').forEach(container => {
            container.removeAttribute('reason'); // Strip the lock
            
            if (container.shadowRoot) {
                // Find the hidden 'Verify' button and CLICK it to fetch media metadata
                const btn = container.shadowRoot.querySelector('button, [role="button"], a');
                if (btn) btn.click();

                // Inject CSS into the Shadow DOM to hide the blur and show the content
                if (!container.shadowRoot.querySelector('style#bypass')) {
                    const style = document.createElement('style');
                    style.id = 'bypass';
                    style.textContent = `
                        [slot="blurred"], .prompt, xpromo-nsfw-blocking-modal-v2 { display: none !important; }
                        [slot="content"] { display: block !important; filter: none !important; }
                    `;
                    container.shadowRoot.appendChild(style);
                }
            }
        });
    }

    // Run every 500ms to catch lazy-loaded content
    setInterval(fixReddit, 500);
})();