Jimmy Breck-McKye

A lazy programmer

Detecting Adblockers

Detecting Adblockers


How adblockers work – Sources are publicly available – Work in separate processes, and wait for elements to be added to the document – Block network requests to URIs – Hide elements with suspicious classnames and src attributes – Work asynchronously – May add other attributes, eg. moz-binding, abp

Safari content blocking – create a list of rules

Detection mechanisms – sacrificial elements, with classes – script tags – images and frames with URIs

Considerations – don’t get false positives

Approaches – best kept async

– would suggest a div with a sacrificer class is the simplest solution