How Adblock Plus works in Chrome?

人盡茶涼 提交于 2019-12-02 19:30:47

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.

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.

sarathkm

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.

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