How does Adblock Plus really work in Chrome?

后端 未结 3 1817
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 01:03

I noticed Adblock Plus injecting some CSS that hides the advertisements, but I think that it does more than that - for example blocking HTTP requests.

How does Adblock Pl

相关标签:
3条回答
  • 2021-02-02 01:25

    They give a brief idea of it here: http://chromeadblock.org/extensions/adblock-for-chrome/

    However no real details. I think what they do is, to check css class and id's for badwords, like: advert, ad, sponsored .... Furthermore, they'll have a list of major Ad Servers like AdWords etc. and simply block those IP's / domains from being loaded. Afterwards it seems like it calculates the dimensions of the removed ad and fills it up with a blank CSS.

    Maybe thats not how they do it, but that is how I would do it.

    0 讨论(0)
  • 2021-02-02 01:25

    Here it is how it is done: https://adblockplus.org/en/faq_internal#elemhide

    They just disable the block the adblock with the list of ids that they have in hand at user agent stylesheet i.e. at your browser level with its JS.

    0 讨论(0)
  • 2021-02-02 01:30

    Adblock Plus has two mechanisms, to block content on websites:

    Element hiding: A CSS snippet is injected in the website, to hide elements that are supposed to be blocked. That way the ads are completely removed from the rendered page, so that the areas otherwise used for ads will now be used for the actual content of the web page, and even content that is part of the web page itself (like text ads) can be blocked. However this doesn't prevent resources from loading in the first place.

    Request blocking: HTTP requests for retrieving resources that are supposed to be blocked will be prevented from loading. This will make the page load faster, reduce traffic, and even enables blocking content that is loaded from within Flash, like the video ads on YouTube.

    Both, the elements to hide on given websites, and the URLs to block, are controlled by filter lists. By default Adblock Plus will use EasyList. But you are free to setup your own filter rules or configure other filter lists.

    0 讨论(0)
提交回复
热议问题