Webmaster... Check if an adblocking extensions is installed and...

Hardware and software discussion.

Moderator: EasyList authors

Post Reply
User avatar
smed79
Liste AR Author
Liste AR Author
Posts: 11129
Joined: Sun Jan 17, 2010 4:00 am
Reputation: 84
Location: EasyList Forum

Webmaster... Check if an adblocking extensions is installed and...

Post by smed79 » Tue Jun 07, 2016 5:59 am

Hi,

Do you have a blog, site, forum and your ou want to help your users? Here CSS/Javascript/HTML code to check if an adblocking extensions is installed ... If Not suggest to install Adblock Plus https://adblockplus.org/.

CSS

Code: Select all

<style>
.abp-box { font-family: "Source Sans Pro", sans-serif;width:360px; padding:10px 15px 10px 35px; margin:5px; color:#555; font-size:11px; top:15px; right:15px; z-index:1000; position:fixed; border-radius:10px; border:1px solid #f5aca6;}
.abp-box:hover{border:1px solid #f00;}
.abp-msg { background:#ffecec url('http://i.imgur.com/n5DKdKZ.png') no-repeat 10px 50%; }
</style>
Javascript

Code: Select all

<script type="text/javascript">
    function PopUp(hideOrshow) {
    if (hideOrshow == 'hide') document.getElementById('ac-wrapper').style.display = "none";
    else document.getElementById('ac-wrapper').removeAttribute('style');
}
window.onload = function () {
    setTimeout(function () {
        PopUp('show');
    }, 10000);
}
</script>
HTML

Code: Select all

<div id="ac-wrapper" style="display:none">
<div class="abp-box abp-msg GoogleAd">Installer <a href="https://adblockplus.org/" title="Installer Adblock Plus" target="_blank"><b>Adblock Plus</b></a> to surf the web without annoying ads! Can blocks banners, pop-ups, tracking, malware and more...</div>
</div>
Result
Image

PS: The javascript code is needed to show up the message 10 seconds after loading the page.
•► Before posting, to find your answer fast, read Forum « RULES » and use « Search »
••► Don't post clickable links » use inline text bbcode notation « [ C ] » or « [ code ] »

Post Reply