Reddit - Auto Unlock 18+

Desbloqueia conteúdo +18

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Reddit - Auto Unlock 18+
// @namespace    http://tampermonkey.net/
// @version      4.0
// @description  Desbloqueia conteúdo +18
// @author       0x001
// @match        https://*.reddit.com/*
// @match        https://www.reddit.com/*
// @run-at       document-idle
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    const KEYWORDS = ['visualizar', 'view', 'nsfw', '18+', 'click'];

    function pierceShadowAndUnlock() {
        // 1. Encontra todos os containers "borrados" específicos do Reddit Novo
        const blurredContainers = document.querySelectorAll('shreddit-blurred-container');

        blurredContainers.forEach(container => {
            // Verifica se já desbloqueamos esse para não ficar processando à toa
            if (container.getAttribute('data-shadow-unlocked')) return;

            // 2. ACESSA O SHADOW DOM (A parte crítica)
            const shadow = container.shadowRoot;

            if (shadow) {
                // --- ESTRATÉGIA 1: Clicar no botão dentro da sombra ---
                // Baseado no seu HTML: <div class="overlay"><button ...>
                const button = shadow.querySelector('button');

                if (button) {
                    const text = button.textContent.toLowerCase();
                    // Se o botão tiver textos suspeitos
                    if (KEYWORDS.some(key => text.includes(key))) {
                        console.log('🔓 Botão encontrado no Shadow DOM. Clicando...');
                        button.click();
                        container.setAttribute('data-shadow-unlocked', 'true');
                    }
                }

                // --- ESTRATÉGIA 2: Força Bruta Visual (Caso o clique falhe) ---
                // Baseado no seu HTML: <span class="inner blurred" style="filter:blur(40px);">
                const blurredSpan = shadow.querySelector('.blurred');
                if (blurredSpan) {
                    blurredSpan.style.filter = 'none !important';
                    blurredSpan.style.opacity = '1';
                    blurredSpan.classList.remove('blurred');
                }

                // Baseado no seu HTML: <div class="overlay">
                const overlay = shadow.querySelector('.overlay');
                if (overlay) {
                    overlay.style.display = 'none';
                }

                // Baseado no seu HTML: <div class="bg-scrim"> (fundo preto)
                const scrim = shadow.querySelector('.bg-scrim');
                if (scrim) {
                    scrim.style.display = 'none';
                }
            }
        });
    }

    // Executa a cada 500ms para garantir que pegue o conteúdo assim que você rola a página
    setInterval(pierceShadowAndUnlock, 500);

})();