79636317

Date: 2025-05-24 00:25:09
Score: 0.5
Natty:
Report link
I put this in a javascript file that is called in every page on my site.
I tested it with Chrome & Firefox.

  var ADS_URL = 'https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js';
    function checkAdsBlocked(callback) {
        var xhr = new XMLHttpRequest();
        xhr.onreadystatechange = function () {
            if (xhr.readyState == XMLHttpRequest.DONE) {
                callback(xhr.status === 0 || xhr.responseURL !== ADS_URL);
            }
        };
        xhr.open('HEAD', ADS_URL, true);
        xhr.send(null);
    }
    
    checkAdsBlocked(function(adsBlocked) {
        if (adsBlocked) {alert ('\n\nPlease Disable Your Ad Blocker\nThere are no annoying ads or popups on this site.\nSome features here are not available with your ad blocker on.\nThanks!\n\n');}
    });
Reasons:
  • Blacklisted phrase (0.5): Thanks
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Robert Finnan