I have not tested this myself, but generally ad blockers try to block any elements on the page that are called "ad", its a lot more simple than you'd expect! So all you need to do is put a div on the page called like "ad" and then check to see if its been deleted or not - I found this script!
// Create a fake ad element
var fakeAd = document.createElement('div');
fakeAd.innerHTML = ' ';
fakeAd.className = 'adsbox';
document.body.appendChild(fakeAd);
// Check if the element is hidden
function detectAdblock() {
if (fakeAd.offsetHeight === 0) {
// Adblock detected
alert('Please disable your adblocker!');
} else {
// No adblock detected
alert('Thank you for not using an adblocker!');
}
}
// Run the function after page load
window.addEventListener('load', detectAdblock);
You could also do it without a script; make a div this has an inner div covering it with class="ad" then if the ad is blocked you'll see whats underneath it ^^