🎉 欢迎访问GreasyFork.Org 镜像站!本镜像站由公众号【爱吃馍】搭建,用于分享脚本。联系邮箱📮

Greasy fork 爱吃馍镜像

Greasy Fork is available in English.

📂 缓存分发状态(共享加速已生效)
🕒 页面同步时间:2026/01/13 11:47:49
🔄 下次更新时间:2026/01/13 12:47:49
手动刷新缓存

AdBlockThisYT2

Evita bloqueos por AdBlock sin romper botones ni dejar fondo oscuro que bloquea clicks. Intenta autoplay sin mute ni botones, y elimina capa .opened./Avoids AdBlock restrictions without breaking buttons or leaving a dark overlay that blocks clicks. Attempts autoplay without mute or buttons, and removes the .opened layer.

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램을 설치해야 합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

🚀 安装遇到问题?关注公众号获取帮助

公众号二维码

扫码关注【爱吃馍】

回复【脚本】获取最新教程和防失联地址

// ==UserScript==
// @name         AdBlockThisYT2
// @namespace    SebaARG22
// @version      3.1.8
// @description  Evita bloqueos por AdBlock sin romper botones ni dejar fondo oscuro que bloquea clicks. Intenta autoplay sin mute ni botones, y elimina capa .opened./Avoids AdBlock restrictions without breaking buttons or leaving a dark overlay that blocks clicks. Attempts autoplay without mute or buttons, and removes the .opened layer.
// @author       SebaARG22
// @match        *://www.youtube.com/*
// @icon         https://i.imgur.com/fd1D46S.png
// @run-at       document-start
// @grant        none
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';

    const LOG_PREFIX = '[😭 CryTubeFix]';

    console.log(`${LOG_PREFIX} Script iniciado.`);

    // CSS para ocultar anuncios y capa .opened
    const css = `
        .ytp-ad-overlay-container,
        .ytp-ad-player-overlay,
        .ytp-ad-module,
        ytd-enforcement-message-view-model[data-adblock-hidden] {
            display: none !important;
        }

        .opened,
        .opened * {
            background: transparent !important;
            pointer-events: none !important;
            user-select: none !important;
            opacity: 0 !important;
            z-index: 0 !important;
        }
    `;
    const style = document.createElement('style');
    style.textContent = css;
    document.documentElement.appendChild(style);

    function removeOpenedOverlay() {
        const openedElements = document.querySelectorAll('.opened');
        openedElements.forEach(el => {
            if (el.parentElement) el.parentElement.style.pointerEvents = 'auto';
            el.remove();
            console.log(`${LOG_PREFIX} Eliminado elemento .opened.`);
        });
    }

    const observer = new MutationObserver(() => {
        const messages = document.querySelectorAll('ytd-enforcement-message-view-model');
        messages.forEach(el => {
            const text = el.innerText?.toLowerCase() || '';
            if (text.includes('ad blocker') || text.includes('bloqueador de anuncios')) {
                el.setAttribute('data-adblock-hidden', 'true');
                document.body.style.overflow = 'auto';
                console.log(`${LOG_PREFIX} Ocultado aviso AdBlock.`);
            }
        });
        removeOpenedOverlay();
    });
    observer.observe(document, { childList: true, subtree: true });
    setInterval(removeOpenedOverlay, 500);

    function autoplayVideo() {
        const video = document.querySelector('video');
        if (!video) {
            setTimeout(autoplayVideo, 500);
            return;
        }

        video.muted = false; // No mute
        video.play().then(() => {
            console.log(`${LOG_PREFIX} Autoplay sin mute iniciado.`);
        }).catch(() => {
            console.warn(`${LOG_PREFIX} Autoplay sin mute fue bloqueado por el navegador.`);
        });
    }

    function setupAutoplayOnPage() {
        autoplayVideo();

        let lastPath = location.pathname;
        setInterval(() => {
            if (location.pathname !== lastPath) {
                lastPath = location.pathname;
                console.log(`${LOG_PREFIX} Cambio de página detectado, intentando autoplay.`);
                autoplayVideo();
            }
        }, 1000);
    }

    if (window.location.pathname.startsWith('/watch')) {
        window.addEventListener('DOMContentLoaded', setupAutoplayOnPage);
    }

})();