Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > alt.html.webedit > #19

ad blocker testscript problem

From "Daniel Rafflenbeul" <daniel-r@gmx.net>
Newsgroups alt.html.webedit
Subject ad blocker testscript problem
Date 2016-10-27 22:06 +0200
Message-ID <e7f534F92cnU1@mid.individual.net> (permalink)

Show all headers | View raw


Hello to all..
I got this ready made script for testing of adblocker.
Itself works fine.

But I need an option to define 2 links  in cause of blocked or not.

Under the body opended there are 2 <p> classes.. Thats working.. and there i
need the Links..

If blocked use link 1 and is not blocked Link 2

Can anyone help me ?


The original script is :

<meta name="viewport" content="width=device-width">
<style type="text/css">
        body {
        background: #f8f8f8;
        font-family: "Segoe UI", Arial, Helvetica, sans-serif;
        font-weight: lighter;
        color: #333;
        padding: 2em;
        }
        .notblocked {
        display: block;
        }
        .blocked {
        display: none;
        }
        .adblock .notblocked {
        display: none;
        }
        .adblock .blocked {
        display: block;
        }
        </style>
        </head>
        <body>

        <p class="notblocked">Nicht blocked</p>
        <p class="blocked">AdBlock is enabled.</p>


        <script>
        (function(){
        var test = document.createElement('div');
        test.innerHTML = '&nbsp;';
        test.className = 'adsbox';
        document.body.appendChild(test);
        window.setTimeout(function() {
        if (test.offsetHeight === 0) {
        document.body.classList.add('adblock');
        }
        test.remove();
        }, 100);
        })();
        </script>
        </body>
        </html>

Back to alt.html.webedit | Previous | Next | Find similar


Thread

ad blocker testscript problem "Daniel Rafflenbeul" <daniel-r@gmx.net> - 2016-10-27 22:06 +0200

csiph-web