• bnn1@thelemmy.club
    link
    fedilink
    English
    arrow-up
    11
    arrow-down
    1
    ·
    22 hours ago

    yep for websites that’s literally just checking if their ad element exists in the DOM tree.

    const myAdElementSelector = "#fuckingAd";
    const myAdElement = document.querySelector(myAdElementSelector);
    if (!myAdElement) return "yes user is using adblocker";
    

    simple as.

    or maybe not honestly i don’t know i just wanted everyone to know i know javascript.

    • Tja@programming.dev
      link
      fedilink
      English
      arrow-up
      7
      ·
      18 hours ago

      2/10, should have used jQuery

      or maybe not honestly I don’t know I just wanted everyone to know I’m old enough to remember classic stackoverflow

    • merc@sh.itjust.works
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      10 hours ago

      You’re running software on my computer to check the state of the web page. That’s spying.