Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Actually, there's no way to really block ad-block.

It wouldn't be too hard to make an ad-blocker that used CSS and Javascript to do all of the blocking during page render. It'd be an inefficient use of bandwidth and rendering time, but it'd be able to block 100% of ads and undetectable from the web server.

In fact, before Opera had a built-in ad-blocker, I think there was an ad-block extension built on its "User Javascript" and custom CSS abilities.



Seriously?

  function verifyAds() {
    if (!adContentsVisible()) {
      loadAdContents();
    }
    setTimeout(verifyAds, 1000);    
  }
  verifyAds();


Huh? Extension can override JavaScript on the page, too, you know:

window.adContentsVisible = function () { return true; }


  (function() {  
    // local scope, can't override
  })();
My point is that I agree with grandparent, that they just allow ads to be shown, and it's not technically impossible to reload ads, or prevent page contents view, if no ads visible.


The plugin can absolutely mock the ad element(s) and make them seem to be visible.


only because sites generally don't do so; if necessary, extensions could get much more aggressive with website scripts, current user script limitations aside.


If it's client-side, it can be defeated. Let's not enter into an arms race of larger and more bandwidth-intensive checkers/blockers to try to get the upper hand. If someone ad blocks, they're not likely in your target demographic anyway.


"During page render".

Render the page, identify the regions of the resulting bitmap which are ads, and blank them out. The browser can always just lie at the end, even after running all of the JavaScript and marking all of the DOM elements to visible.


Also, it is possible to block 3rd party ads without touching the browser by going straight into the underlying IP routing tables.


I use http://someonewhocares.org/hosts/ as my hosts file, and it works great. It doesn't remove the placeholder for the ad, but it does stop it from downloading.


Yes, but it's easy for a browser to just override your verifyAds function.


If they find a way to force the visibility of ads, we still could move them to the bottom of the page.


greasemonkey:

    function adContentsVisible() { return true }


not if it's defined in local context.


I can modify my browser's javascript interpreter if I need to.


Mobile Safari successfully refrains from adblocking.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: