• KiranWells@pawb.social
    link
    fedilink
    arrow-up
    6
    ·
    2 年前

    Not all ad blockers remove elements from web pages, and if they acted that predictably you could detect the ad blocker by detecting whether an expected element is hidden.

    I have not looked through an ad blocker’s code, but I don’t believe it is that simple.

    • autokludge@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 年前

      Looking at this blogpost for a wordpress blocking plugin, it basically is just adding a bunch of css classes commonly used by ads to a div and some workarounds to support ad blockers that work by blocking files.