ZeroAd Engine

Bypass ads and skip interruptions in HTML5 games. Instantly auto-completes Poki SDK ads (commercialBreak/rewardedBreak), AdInPlay ads, and CrazyGames reward overlays/promo screens. Blocks iframes, video ads, intrusive containers, and adblock detection warnings. Improved future-proof AdInPlay bypass + adblock evasion (tested on taming.io, Poki, CrazyGames, Ninja.io).

Versión del día 11/2/2026. Echa un vistazo a la versión más reciente.

Tendrás que instalar una extensión para tu navegador como Tampermonkey, Greasemonkey o Violentmonkey si quieres utilizar este script.

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

Tendrás que instalar una extensión como Tampermonkey o Violentmonkey para instalar este script.

Necesitarás instalar una extensión como Tampermonkey o Userscripts para instalar este script.

Tendrás que instalar una extensión como Tampermonkey antes de poder instalar este script.

Necesitarás instalar una extensión para administrar scripts de usuario si quieres instalar este script.

(Ya tengo un administrador de scripts de usuario, déjame instalarlo)

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Tendrás que instalar una extensión como Stylus antes de poder instalar este script.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

Para poder instalar esto tendrás que instalar primero una extensión de estilos de usuario.

(Ya tengo un administrador de estilos de usuario, déjame instalarlo)

// ==UserScript==
// @name ZeroAd Engine
// @namespace http://tampermonkey.net/
// @version 2026.02.12.1
// @description Bypass ads and skip interruptions in HTML5 games. Instantly auto-completes Poki SDK ads (commercialBreak/rewardedBreak), AdInPlay ads, and CrazyGames reward overlays/promo screens. Blocks iframes, video ads, intrusive containers, and adblock detection warnings. Improved future-proof AdInPlay bypass + adblock evasion (tested on taming.io, Poki, CrazyGames, Ninja.io).
// @author Updated with Grok
// @match *://*/*
// @license MIT
// @grant none
// ==/UserScript==

(function () {
    'use strict';

    /////////////////////////////////////////////
    // [1] Robust Direct Function Patch for PokiSDK
    /////////////////////////////////////////////

    function patchPokiSDK() {
        if (typeof window.PokiSDK !== 'object') return false;

        const sdk = window.PokiSDK;

        if (sdk.__patched) return true;
        sdk.__patched = true;

        const instantResolve = (value = undefined) => Promise.resolve(value);

        if (typeof sdk.init === 'function') {
            sdk.init = function (...args) {
                console.log('[AdBypasser] 🚀 PokiSDK.init instantly resolved');
                return instantResolve();
            };
        }

        if (typeof sdk.commercialBreak === 'function') {
            sdk.commercialBreak = function (onStart) {
                console.log('[AdBypasser] ⏭ PokiSDK.commercialBreak skipped');
                if (typeof onStart === 'function') onStart();
                return instantResolve();
            };
        }

        if (typeof sdk.rewardedBreak === 'function') {
            sdk.rewardedBreak = function (options = {}) {
                console.log('[AdBypasser] 🎁 PokiSDK.rewardedBreak instantly rewarded');
                if (typeof options === 'function') options();
                else if (typeof options.onStart === 'function') options.onStart();
                return instantResolve(true);
            };
        }

        if (typeof sdk.displayAd === 'function') {
            sdk.displayAd = function () {
                console.log('[AdBypasser] 🚫 PokiSDK.displayAd blocked');
                return instantResolve();
            };
        }

        if (typeof sdk.destroyAd === 'function') {
            sdk.destroyAd = function () {
                console.log('[AdBypasser] 🗑️ PokiSDK.destroyAd suppressed');
            };
        }

        console.log('[AdBypasser] 🧠 PokiSDK fully patched');
        return true;
    }

    /////////////////////////////////////////////
    // [2] Enhanced AdInPlay SDK Patch (future-proof + callback/promise support)
    /////////////////////////////////////////////

    function patchAdInPlay() {
        if (typeof window.adinplay !== 'object' || window.adinplay.__patched) return;

        window.adinplay.__patched = true;
        console.log('[AdBypasser] 🔒 AdInPlay SDK neutralized (enhanced)');

        const blockedMethods = [
            'play', 'preroll', 'midroll', 'postroll', 'banner',
            'rewarded', 'reward', 'rewardVideo', 'interstitial',
            'show', 'showAd', 'display', 'displayAd', 'init'
        ];

        window.adinplay = new Proxy(window.adinplay, {
            get(target, prop) {
                if (blockedMethods.includes(prop)) {
                    return (...args) => {
                        console.log(`[AdBypasser] ⛔ AdInPlay.${String(prop)}() blocked & resolved`);
                        // Call any callbacks (common pattern)
                        args.forEach(arg => {
                            if (typeof arg === 'function') arg();
                        });
                        // Resolve with success for rewarded types
                        const isRewarded = /reward/i.test(String(prop));
                        return Promise.resolve(isRewarded ? true : undefined);
                    };
                }
                return target[prop];
            }
        });
    }

    /////////////////////////////////////////////
    // [3] DOM Ad + Adblock Warning Nuker Selectors
    /////////////////////////////////////////////

    const adSelectors = [
        '#preroll', '#adsbox',
        'iframe[src*="ads"]', 'iframe[title="Advertisement"]',
        'video[title="Advertisement"]',
        '[id^="ad_"]', '[id$="_ad"]', '[id="ad"]',
        '[class="ad"]', '[class^="ad-"]', '[class$="-ad"]',
        '[class~="ad-banner"]', '[class~="adbox"]', '[class~="adunit"]',
        '[class*="pokiSdk"]', 'div[id^="google_ads"]', 'div[id^="div-gpt"]',
        'div[class*="banner-ad"]', 'div[class*="ad-wrapper"]',
        'script[src*="ads"]',
        '.pokiSdkContainer', '.pokiSdkVideoContainer', '.pokiSDKAdContainer',
        '.pokiSdkSpinnerContainer', '.pokiSdkPauseButtonContainer', '.pokiSdkStartAdButton',
        '.ad-container', '.video-ad', '.interstitial-ad', '.rewarded-ad',
        '[class*="poki-pill"]', '.poki-pill',
        // Adblock detection/warning overlays (common patterns)
        '[class*="adblock"]', '[id*="adblock"]',
        '[class*="blocker"]', '[id*="blocker"]',
        '.adblock-warning', '.adblocker-modal', '.adblock-detected',
        '#adblock', '#disableAdblock', '.please-disable-adblock',
        '.adb-modal', '.adblocker-message', '.disable-adblock-message'
    ];

    const removedSelectors = new Set();

    function removeAdElements() {
        adSelectors.forEach(selector => {
            const elements = document.querySelectorAll(selector);
            if (elements.length > 0) {
                elements.forEach(el => el.remove());
                if (!removedSelectors.has(selector)) {
                    console.log(`[AdBypasser] 💣 Removed: ${selector}`);
                    removedSelectors.add(selector);
                }
            }
        });
    }

    function safeRemoveAdElements() {
        if ('requestIdleCallback' in window) {
            requestIdleCallback(removeAdElements, { timeout: 100 });
        } else {
            setTimeout(removeAdElements, 0);
        }
    }

    /////////////////////////////////////////////
    // [4] CrazyGames Promo Skip
    /////////////////////////////////////////////

    function handleCrazyGamesPromo() {
        const btn = document.getElementById('mainContinuePlayingButton');
        if (btn) {
            console.log('[AdBypasser] 🎯 CrazyGames promo detected — auto-clicking Continue');
            btn.click();
            let promoDiv = btn.closest('div.MuiGrid-root');
            if (promoDiv) {
                promoDiv.remove();
                console.log('[AdBypasser] 💥 CrazyGames promo container removed');
            }
        }
    }

    /////////////////////////////////////////////
    // [5] MutationObserver
    /////////////////////////////////////////////

    function startMutationWatch() {
        const observer = new MutationObserver(() => {
            patchAdInPlay();
            safeRemoveAdElements();
            handleCrazyGamesPromo();
        });

        observer.observe(document.documentElement, {
            childList: true,
            subtree: true
        });

        console.log('[AdBypasser] 👁️ MutationObserver activated');
    }

    /////////////////////////////////////////////
    // [6] Iframe Ad Remover
    /////////////////////////////////////////////

    const iframeObserver = new MutationObserver(() => {
        document.querySelectorAll('iframe').forEach(iframe => {
            try {
                const src = iframe.src || iframe.getAttribute('src');
                if (src && /ads|doubleclick|preroll|videoads/i.test(src)) {
                    iframe.remove();
                    console.log('[AdBypasser] 🪓 Removed suspicious iframe:', src);
                }
            } catch (e) { }
        });
    });

    iframeObserver.observe(document.body || document.documentElement, {
        childList: true,
        subtree: true
    });

    /////////////////////////////////////////////
    // [7] Initialization
    /////////////////////////////////////////////

    window.addEventListener('DOMContentLoaded', () => {
        let attempts = 0;
        const maxAttempts = 20;
        const interval = setInterval(() => {
            if (patchPokiSDK() || attempts++ >= maxAttempts) {
                clearInterval(interval);
                if (attempts >= maxAttempts) {
                    console.warn('[AdBypasser] PokiSDK patch timeout');
                }
            }
        }, 800);

        patchAdInPlay();
        safeRemoveAdElements();
        handleCrazyGamesPromo();
        startMutationWatch();
    });

    const runtime = setInterval(() => {
        patchPokiSDK();
        patchAdInPlay();
        safeRemoveAdElements();
        handleCrazyGamesPromo();
    }, 1000);

    setTimeout(() => {
        clearInterval(runtime);
        console.log('[AdBypasser] 🛑 Startup interval cleared');
    }, 30000);

})();