0

Trying to block background ad on: www.mx.dk I have found the following:

The ad is an image attached to the The onClick listener is added to #wrapper The wrapper contains the entire page

This piece of code seems to be placing the ad:

var displayWallpaper = function (data) {
if(data.type && data.link) {
    $(document).find('#site-wrapper, #footer').css('cursor', 'default');
    $(document).find('body').css({'cursor': 'pointer','height': '100%','min-height': '1880px','min-width': '1314px'});
    $( "<style type='text/css'>body { background: #ffffff url('"+ data.type +"') no-repeat fixed center top; }</style>" ).appendTo( "head" );

    $(window.parent.document).find('body, #wrapper').bind('click', function (e) {
        if (e.target !== this) {
            return;
        }

        var adClickURL = data.link;

        window.open(adClickURL);
    });
}
}

So how do I tell AdBlock Plus to hide and disable the ad? Blocking #wrapper blocks the entire page

I am using Chrome 55.0.2883.87 on Windows 10 64bit Same problem in my Firefox

1 Answer 1

1

Usually, you wouldn't want to hide an ad unless you can't block it. The difference is that blocking an ad means that it won't be downloaded, hiding it only causes it not to be shown.

Since you can't hide the ad in this case anyway, due to it containing all of the content, you should block the request to the ad image. For that you need to find out what values data.type can have and create an appropriate filter for it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.