File size: 2,347 Bytes
f9a2505
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
document.addEventListener('DOMContentLoaded', () => {
    const iframe = document.getElementById('gameContainer');
    const loader = document.getElementById('loader');
    
    const adBlockConfig = {
        scripts: [
            /adservice|adsystem|doubleclick|googletag|adserver|advert|tracking|analytics/gi,
            /nannyirrationalacquainted|prosecutorremarkablegodforsaken|recordedthereby/gi
        ],
        elements: [
            'div[class*="ad"]',
            'iframe[src*="ads"]',
            'ins.adsbygoogle',
            '#___gcse_0',
            '.gsc-adBlock',
            '[id*="ad-container"]',
            '[class*="banner"]',
            'img.menu-search'
        ]
    };

    function nuclearAdBlock() {
        try {
            const iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
            
            // Block scripts
            iframeDoc.querySelectorAll('script').forEach(script => {
                if(adBlockConfig.scripts.some(regex => regex.test(script.src))) {
                    script.remove();
                }
            });

            // Block elements
            adBlockConfig.elements.forEach(selector => {
                iframeDoc.querySelectorAll(selector).forEach(el => el.remove());
            });

            // Inject CSS
            const style = iframeDoc.createElement('style');
            style.textContent = adBlockConfig.elements.join(',') + 
                '{display:none!important;height:0!important;width:0!important;opacity:0!important;visibility:hidden!important}';
            iframeDoc.head.appendChild(style);

        } catch(e) {
            console.error('Adblock Error:', e);
        }
    }

    // Initialize
    iframe.src = 'https://gam.onl';
    
    iframe.onload = () => {
        nuclearAdBlock();
        iframe.style.visibility = 'visible';
        loader.remove();
        
        // Continuous protection
        const observer = new MutationObserver(nuclearAdBlock);
        observer.observe(iframe.contentDocument.documentElement, {
            childList: true,
            subtree: true,
            attributes: true
        });
    };

    // Handle errors
    iframe.onerror = () => {
        loader.textContent = 'Errore di caricamento!';
    };
});