3 ms·
Nice idea! Is there any resource on how modern ad blockers detect and block ad banners?
by InGodsName 8y ago
Nice idea! Is there any resource on how modern ad blockers detect and block ad banners?
- greenyoda 8y agoSome ad blockers, like uBlock Origin, are open source, so you can examine the code and see what they're doing: https://github.com/gorhill/uBlock https://github.com/gorhill/uBlock The basic algorithm is to match URLs of loadable resources (images, JavaScript files, iframes, etc.) against huge lists of ad/malware/tracking sites. If the URL matches, the resource isn't loaded. The lists that uBlock Origin uses are enumerated here: https://github.com/gorhill/uBlock/blob/master/README.md https://github.com/gorhill/uBlock/blob/master/README.md
- detaro 8y agoAs greenyoda suggested, I'd start with source and documentation of uBlock. From what I know, the major blockers share the format for their blocklists. There's two types of blocks: visual blocks, which contain a CSS selector to hide, and network blocks. Since the latter commonly block scripts that load ad elements, you'd probably need to load the page twice, to observe what elements are not created when the ad-scripts are blocked.