Check if request was blocked by user with javascript -


i'm coding function detect if users using adblockers. when detect send site catalyst (omniture).

the problem is: adblockers use black list block requests , company catalyst url it's in 1 of these lists. when in devtools block requests , show err_blocked_by_client. there's way check if request blocked client using javascript?

detecting ad blocker easy check answer might helpful how detect ad blocking , show message

you can check out might detect-adblocker

its implementation of timing answer

add before script in head tag:

<head>     <title></title>     <meta/>      <!--adblocker detection code - start-->     <script src="//adblocker.fortiapp.com/ads.js"></script>     <script>         (function (i, o, g, r) {             i[o] = (typeof i[o] == typeof undefined) ? g : r         })(window, 'adblocker', true, false);     </script>     <!--adblocker detection code - end-->      // other scripts  </head> 

then later use it:

if (adblocker) {     // add blocker enabled }else{     // ad blocker not enabled } 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -