AdBlock plus hids elements with ids or class with the word “ad”

徘徊边缘 提交于 2019-11-30 02:35:15

问题


I have two divs in my site one with id ad_holder and another with id ad_buttons"

When testing the site on Mozilla with ad block plus installed I noticed that both divs were hidden. On further inspection I noticed it that Adblock was the culprit probably because of the ID names. I also noticed that Adblock created (or maybe has a ready made) CSS file, that sets the display to hidden.

I know I can fix this by simply changing the IDs or trying to override the Adblock CSS but still need to know if there is yet another alternative way of fixing this, like a small piece of code that tells Adblock it's not a real ad.

The contents of the divs are not real ads, it just holds .jpegs about the client's business.


回答1:


It's better to rename your classes and id's. I would say, that image names, directories also can cause accident disappearing. Solution is to avoid words like:

  • ad
  • ads
  • adv
  • advert
  • advertisement
  • banner
  • banners



回答2:


List could be found here. Just double check because different on version and software, but i think it cover most of parts. https://easylist.to/



来源:https://stackoverflow.com/questions/14079048/adblock-plus-hids-elements-with-ids-or-class-with-the-word-ad

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!