JSFiddle - React, Tailwind, and code Playground
by Ali Uygur
HTML
<div class="id-primary-owned-pets">
<div>
<div>
<div>
</div>
</div>
</div>
</div>
JavaScript
document.addEventListener('DOMContentLoaded', function() {
var adBlockEnabled = false;
var testAd = document.createElement('div');
testAd.innerHTML = ' ';
testAd.className = 'adsbox';
testAd.style.position = 'absolute';
testAd.style.top = '-10px';
testAd.style.left = '-10px';
testAd.style.height = '1px';
testAd.style.width = '1px';
document.body.appendChild(testAd);
window.setTimeout(function() {
if (testAd.offsetHeight === 0) {
adBlockEnabled = true;
// AdBlock tespit edildiğinde yapılacak işlemler
if (adBlockEnabled) {
// Modal pencereyi göster
showModal();
}
}
testAd.remove();
}, 100);
function showModal() {
// Modal pencereyi gösterme kodu buraya eklenebilir
// Örneğin, bir div elementi oluşturarak modal pencereyi görüntüleyebilirsiniz
var modalDiv = document.createElement('div');
modalDiv.style.position = 'fixed';
modalDiv.style.top = '50%';
modalDiv.style.left = '50%';
modalDiv.style.transform = 'translate(-50%, -50%)';
modalDiv.style.background = '#fff';
modalDiv.style.padding = '20px';
modalDiv.style.border = '2px solid #ccc';
modalDiv.style.zIndex = '9999';
modalDiv.innerHTML = 'AdBlock tespit edildi! Lütfen reklamları desteklemek için AdBlock\'u devre dışı bırakın.';
document.body.appendChild(modalDiv);
}
});