How to detect Adblock on my website?

If you enter to that site and your browser has some kind of adblock software enabled, then the site instead of showing the actual ads shows a little banner telling the users that the ad revenue is used for hosting the project and they should consider turning Adblock off.

This one works good

if there’s an adBlocker it will alert you

<!DOCTYPE html>
<meta name=”viewport” content=”width=device-width, initial-scale=1″>



function checkAdBlocker() {
try {
new Request(“”, {
method: ‘HEAD’,
mode: ‘no-cors’
})).catch(error => {
} catch (e) {
// Request failed, likely due to ad blocker

function showNotification() {
alert(“Please disable adBlocker”)