mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
35 lines
1.4 KiB
Plaintext
35 lines
1.4 KiB
Plaintext
<% if Rails.env.production? %>
|
|
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
|
|
<ins class="adsbygoogle"
|
|
style="display:block; text-align:center;"
|
|
data-ad-layout="in-article"
|
|
data-ad-format="fluid"
|
|
data-ad-client="ca-pub-6845455733812572"
|
|
data-ad-slot="4570729233"></ins>
|
|
<script>
|
|
(adsbygoogle = window.adsbygoogle || []).push({});
|
|
</script>
|
|
<% end %>
|
|
<div class="alert alert-danger alert-dismissible" id="blocked_message" style="display: none;"><a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
|
|
<p>We've detected that you have an ad blocker enabled! Please consider disabling it for <strong>wrestlingdev.com</strong>. This site is free for users and supported by ads. Ad blockers also block performance monitoring that help us with user experience.</p>
|
|
</div>
|
|
<script>
|
|
let fakeAd = document.createElement("div");
|
|
fakeAd.className = "textads banner-ads banner_ads ad-unit ad-zone ad-space adsbox"
|
|
|
|
fakeAd.style.height = "1px"
|
|
|
|
document.body.appendChild(fakeAd)
|
|
|
|
let x_width = fakeAd.offsetHeight;
|
|
let msg = document.getElementById("msg")
|
|
|
|
|
|
if(x_width){
|
|
console.log("No AdBlocker Detected")
|
|
}else{
|
|
console.log("AdBlocker detected")
|
|
document.getElementById("blocked_message").style.display = 'block';
|
|
}
|
|
</script>
|