Cómo bloquear a los bloqueadores de anuncios
Ultimamente se ha puesto de moda los Adblockers en extensiones para los navegadores o como App para los móviles, todo está muy bien, salvo que muchos sitios dependen unicamente de la publicidad para generar sus ingresos.
Este código ha sido probado y crea una ventana emergente cuando un usuario con este software es detectado por un sitio web.
<!-- Begin AdBlock block-->
<script type="text/javascript">
window.c4vl39 = { ad: '' + Math.random().toString(36), shade: '' + Math.random().toString(36) }
document.write('<div style="width: 0px; height: 0px; overflow: hidden;"><div id="' + c4vl39.ad + '" class="BannerAd AdArea AdContainer AdDiv AdDiv AdPanel AdServer AdsDiv AdsFrame ad-banner" style="height: 1px; width: 1px;"></div></div>\n');
document.write('<div id="' + c4vl39.shade + '" style="display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 1000; margin: 0; padding: 0;">\n');
</script>
<!-- Begin block dialog -->
<!-- TODO: Customize the text and the look and feel -->
<div style="position: absolute; width: 100%; height: 100%; background-color: #888; opacity: 0.90;"></div>
<div style="position: absolute; width: 100%; height: 100%;">
<div style="margin: 150px auto 0 auto; width: 700px; padding: 40px; min-height: 200px;background-color: white; border: 1px solid black;">
<h1 style="color: black;">We're committed to hosting safe ads and respect your privacy.</h1>
<img style="float: left; margin: 10px 30px 10px 0px; width: 250px;"src="https://upload.wikimedia.org/wikipedia/commons/7/7d/Diarioeluniverso.JPG" />
<p style="color: black; margin-top: 30px;">To keep reading, please disable your ad blocker and reload the page.</p>
<div style="clear: both;"></div>
</div>
</div>
<!-- End block dialog -->
<script type="text/javascript">
document.write('</div>\n');
setInterval(function() { try { if (document.getElementById(c4vl39.ad).offsetHeight === 0) { document.getElementById(c4vl39.shade).style.display = 'block'; } } catch(e) {} }, 1000);
</script>
<!-- End AdBlock block -->
Este código ha sido probado y crea una ventana emergente cuando un usuario con este software es detectado por un sitio web.
<!-- Begin AdBlock block-->
<script type="text/javascript">
window.c4vl39 = { ad: '' + Math.random().toString(36), shade: '' + Math.random().toString(36) }
document.write('<div style="width: 0px; height: 0px; overflow: hidden;"><div id="' + c4vl39.ad + '" class="BannerAd AdArea AdContainer AdDiv AdDiv AdPanel AdServer AdsDiv AdsFrame ad-banner" style="height: 1px; width: 1px;"></div></div>\n');
document.write('<div id="' + c4vl39.shade + '" style="display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 1000; margin: 0; padding: 0;">\n');
</script>
<!-- Begin block dialog -->
<!-- TODO: Customize the text and the look and feel -->
<div style="position: absolute; width: 100%; height: 100%; background-color: #888; opacity: 0.90;"></div>
<div style="position: absolute; width: 100%; height: 100%;">
<div style="margin: 150px auto 0 auto; width: 700px; padding: 40px; min-height: 200px;background-color: white; border: 1px solid black;">
<h1 style="color: black;">We're committed to hosting safe ads and respect your privacy.</h1>
<img style="float: left; margin: 10px 30px 10px 0px; width: 250px;"src="https://upload.wikimedia.org/wikipedia/commons/7/7d/Diarioeluniverso.JPG" />
<p style="color: black; margin-top: 30px;">To keep reading, please disable your ad blocker and reload the page.</p>
<div style="clear: both;"></div>
</div>
</div>
<!-- End block dialog -->
<script type="text/javascript">
document.write('</div>\n');
setInterval(function() { try { if (document.getElementById(c4vl39.ad).offsetHeight === 0) { document.getElementById(c4vl39.shade).style.display = 'block'; } } catch(e) {} }, 1000);
</script>
<!-- End AdBlock block -->
Comentarios
Publicar un comentario