Ad Blocker detection AKA Adblock Plus

前端 未结 15 1397
北海茫月
北海茫月 2020-12-02 06:14

After searching Google and Stackoverflow for a few hours I could not find a solution. What I\'m trying to do is detect Adblock plus and display a simple message for now.

15条回答
  •  半阙折子戏
    2020-12-02 06:26

    In my case ADB was hiding the content even that there were no ads.. ( just because the ad word was present in many urls, because it was the post type slug.. )

    But I noticed that they don't remove the content, just applying display: none to the body

    So as an extra solution,

    I just noticed that applying display: block !important; to de body, prevents hiding the content by Adblock plus

    
      you should see this anyway
     
    

提交回复
热议问题