|
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;
|
|
|
|
|
|
iframeDoc.querySelectorAll('script').forEach(script => {
|
|
if(adBlockConfig.scripts.some(regex => regex.test(script.src))) {
|
|
script.remove();
|
|
}
|
|
});
|
|
|
|
|
|
adBlockConfig.elements.forEach(selector => {
|
|
iframeDoc.querySelectorAll(selector).forEach(el => el.remove());
|
|
});
|
|
|
|
|
|
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);
|
|
}
|
|
}
|
|
|
|
|
|
iframe.src = 'https://gam.onl';
|
|
|
|
iframe.onload = () => {
|
|
nuclearAdBlock();
|
|
iframe.style.visibility = 'visible';
|
|
loader.remove();
|
|
|
|
|
|
const observer = new MutationObserver(nuclearAdBlock);
|
|
observer.observe(iframe.contentDocument.documentElement, {
|
|
childList: true,
|
|
subtree: true,
|
|
attributes: true
|
|
});
|
|
};
|
|
|
|
|
|
iframe.onerror = () => {
|
|
loader.textContent = 'Errore di caricamento!';
|
|
};
|
|
}); |