# Ad blocking

Ad blocking or ad filtering is a software capability for blocking or altering online advertising in a web browser, an application or a network. This may be done using browser extensions or other methods or browsers with inside blocking.

## History

The first ad blocker was Internet Fast Forward, a plugin for the Netscape Navigator browser, developed by PrivNet and released in 1996. The AdBlock extension for Firefox was developed in 2002, with Adblock Plus being released in 2006. uBlock Origin, originally called "uBlock", was first released in 2014.

## Technologies and native countermeasures

Online advertising exists in a variety of forms, including web banners, pictures, animations, embedded audio and video, text, or pop-up windows, and can even employ audio and video autoplay. Many browsers offer some ways to remove or alter advertisements: either by targeting technologies that are used to deliver ads (such as embedded content delivered through browser plug-ins or via HTML5), targeting URLs that are the source of ads, or targeting behaviors characteristic of ads (such as the use of HTML5 AutoPlay of both audio and video).

## Prevalence

Use of mobile and desktop ad blocking software designed to remove traditional advertising grew by 41% worldwide and by 48% in the U.S. between Q2 2014 and Q2 2015. As of Q2 2015, 45 million Americans were using ad blockers. In a survey research study released Q2 2016, Met Facts reported 72 million Americans, 12.8 million adults in the UK, and 13.2 million adults in France were using ad blockers on their PCs, smartphones, or tablet computers. In March 2016, the Internet Advertising Bureau reported that UK ad blocking was already at 22% among people over 18 years old.
As of 2021, 27% of US Internet users used ad blocking software, a trend that has been increasing since 2014.
Among technical audiences the rate of blocking reached 58% as of 2021.

## Benefits

For users, benefits of ad blocking software include quicker loading and cleaner looking web pages with fewer distractions, protection from malvertising, stopping intrusive actions from ads, reducing the amount of data downloaded by the user, lower power consumption, privacy benefits gained through the exclusion of web tracking, and preventing undesirable websites from making ad revenue out of the user's visit.
Publishers and their representative trade bodies, on the other hand, argue that web ads provide revenue to website owners, which enable the website owners to create or otherwise purchase content for the website. Publishers state that the prevalent use of ad blocking software and devices could adversely affect website owner revenue.

### User experience

Ad blocking software may have other benefits to users' quality of life, as it decreases Internet users' exposure to advertising and marketing industries, which promote the purchase of numerous consumer products and services that are potentially harmful or unhealthy and on creating the urge to buy immediately. The average person sees more than 5000 advertisements daily, many of which are from online sources.
Unwanted advertising can also harm the advertisers themselves if users become annoyed by the ads. Irritated users might make a conscious effort to avoid the goods and services of firms which are using annoying "pop-up" ads which block the Web content the user is trying to view. For users not interested in making purchases, the blocking of ads can also save time. Any ad that appears on a website exerts a toll on the user's "attention budget" since each ad enters the user's field of view and must either be consciously ignored or closed, or dealt with in some other way. A user who is strongly focused on reading solely the content that they are seeking likely has no desire to be diverted by advertisements that seek to sell unneeded or unwanted goods and services. In contrast, users who are actively seeking items to purchase might appreciate advertising, in particular targeted ads.

### Security

Another important aspect is improving security; online advertising subjects users to a higher risk of infecting their devices with computer viruses than surfing pornography websites. In a high-profile case, the malware was distributed through advertisements provided to YouTube by a malicious customer of Google's Doubleclick. In August 2015, a 0-day exploit in the Firefox browser was discovered in an advertisement on a website. When Forbes required users to disable ad blocking before viewing their website, those users were immediately served with pop-under malware. The Australian Signals Directorate recommends individuals and organizations block advertisements to improve their information security posture and mitigate potential malvertising attacks and machine compromise. The information security firm Webroot also notes employing ad blockers provides effective countermeasures against malvertising campaigns for less technically sophisticated computer users. Ad blocking is recommended by the FBI to prevent online scams.

### Monetary

Ad blocking reduces page load time and saves bandwidth for the users. Users who pay for total transferred bandwidth ("capped" or pay-for-usage connections), including most mobile users worldwide, have a direct financial benefit from filtering an ad before it is loaded. Using an ad blocker is a common method of improving internet speeds. Analysis of the 200 most popular news sites (as ranked by Alexa) in 2015 showed that Mozilla Firefox Tracking Protection led to a 39% reduction in data usage and a 44% median reduction in page load time. According to research performed by The New York Times, ad blockers reduced data consumption and sped upload time by more than half on 50 news sites, including The New York Times itself. Journalists concluded that "visiting the home page of Boston.com (the site with most ad data in the study) every day for a month would cost the equivalent of about $9.50 in data usage just for the ads".
It is a known problem with most web browsers, including Firefox, that restoring sessions often plays multiple embedded ads at once. However, this annoyance can easily be averted simply by setting the web browser to clear all cookies and browsing-history information each time the browser software is closed. Another preventive option is to use a script blocker, which enables the user to disable all scripts and then to selectively re-enable certain scripts as desired, in order to determine the role of each script. The user thus can very quickly learn which scripts are truly necessary (from the standpoint of webpage functionality) and consequently which sources of scripts are undesirable, and this insight is helpful in visiting other websites in general. Thus by precisely controlling which scripts are run in each webpage viewed, the user retains full control over what happens on their computer CPU and computer screen.

## Methods

One method of filtering is simply to block (or prevent auto play of) Flash animation or image loading or Microsoft Windows audio and video files. This can be done in most browsers easily and also improves security and privacy. This crude technological method is refined by numerous browser extensions. Every web browser handles this task differently, but, in general, one alters the options, preferences or application extensions to filter specific media types. An additional add-on is usually required to differentiate between ads and non-ads using the same technology, or between wanted and unwanted ads or behaviors.
The more advanced ad-blocking filter software allows fine-grained control of advertisements through features such as blacklists, whitelists, and regular expression filters. Certain security features also have the effect of disabling some ads. Some antivirus software can act as an ad blocker. Filtering by intermediaries such as ISP providers or national governments is increasingly common.

### Browser integration

As of 2015, many web browsers block unsolicited pop-up ads automatically. Current versions of Konqueror, Microsoft Edge, and Firefox also include content filtering support out-of-the-box. Content filtering can be added to Firefox, Chromium-based browsers, Opera, Safari, and other browsers with extensions such as AdBlock, Adblock Plus, and uBlock Origin, and a number of sources provide regularly updated filter lists. Adblock Plus is included in the freeware browser Maxthon from the People's Republic of China by default.
Another method for filtering advertisements uses Cascading Style Sheets (CSS) rules to hide specific HTML and XHTML elements. This was once handled directly by a browser's user style sheet and custom CSS files. The CSS files employed regular expressions to describe a general advertisement profile. An example CSS selector from the once popular Floppy Moose (2003) style sheet is below. It simply hides anything with a link containing the characters "ad."
Stylesheets are still used to block ads today. However they are almost always used by an ad-blocking extension that combines CSS with other techniques. AdBlock Plus syntax includes CSS selectors which they call "element hiding" rules. The newer uBlock Origin even allows "cosmetic filters" which inject custom CSS declarations. Due to changes in advertising techniques, modern ad-blockers use more specific selectors, more frequently updated selectors, and a greater quantity of selectors. For example, the Floppy Moose style sheet originally contained 40 lines of CSS. In 2022, Easylist contains thousands of CSS selectors. In contrast to the general example above, below is one of the many specific CSS selectors from Easylist (2022).
In January 2016, Brave, a free, ad-blocking browser for Mac, PC, Android, and iOS devices was launched. Brave users can optionally enable Brave's own ad network to earn Basic Attention Tokens (BATs), a type of cryptocurrency, which can be sent as micro-payments to publishers.
At the beginning of 2018, Google confirmed that the built-in ad blocker for the Chrome/Chromium browsers would go live on 15 February: this ad blocker only blocks certain ads as specified by the Better Ads Standard (defined by the Coalition for Better Ads, in which Google itself is a board member). This built-in ad blocking mechanism is disputed because it could unfairly benefit Google's advertising itself.
In 2019, both Apple and Google began to make changes to their web browsers' extension systems which encourage the use of declarative content blocking using pre-determined filters processed by the web browser, rather than filters processed at runtime by the extension. Both vendors have imposed limits on the number of entries that may be included in these lists, which have led to (especially in the case of Chrome) allegations that these changes are being made to inhibit the effectiveness of ad blockers.

### External programs

A number of external software applications offer ad filtering as a primary or additional feature. A traditional solution is to customize an HTTP proxy (or web proxy) to filter content. These programs work by caching and filtering content before it is displayed in a user's browser. This provides an opportunity to remove not only ads but also content that may be offensive, inappropriate, or even malicious (Drive-by download). Popular proxy software which blocks content effectively include Netnanny, Privoxy, Squid, and some content-control software. The main advantage of the method is freedom from implementation limitations (browser, working techniques) and centralization of control (the proxy can be used by many users). Proxies are very good at filtering ads, but they have several limitations compared to browser-based solutions. For proxies, it is difficult to filter Transport Layer Security (SSL) (https://) traffic and full webpage context is not available to the filter. As well, proxies find it difficult to filter JavaScript-generated ad content.

### Hosts file and DNS manipulation

Most operating systems, even those which are aware of the Domain Name System (DNS), still offer backward compatibility with a locally administered list of foreign hosts. This configuration, for historical reasons, is stored in a flat text file that by default contains very few hostnames and their associated IP addresses. Editing this hosts file is simple and effective because most DNS clients will read the local hosts file before querying a remote DNS server. Storing black-hole entries in the hosts file prevents the browser from accessing an ad server by manipulating the name resolution of the ad server to a local or nonexistent IP address (127.0.0.1 or 0.0.0.0 are typically used for IPv4 addresses). While simple to implement, these methods can be circumvented by advertisers, either by hard-coding, the IP address of the server that hosts the ads (this, in its turn, can be worked around by changing the local routing table by using for example iptables or other blocking firewalls), or by loading the advertisements from the same server that serves the main content; blocking name resolution of this server would also block the useful content of the site.
Using a DNS sinkhole by manipulating the hosts file exploits the fact that most operating systems store a file with IP address, domain name pairs which is consulted by most browsers before using a DNS server to look up a domain name. By assigning the loopback address to each known ad server, the user directs traffic intended to reach each ad server to the local machine or to a virtual black hole of /dev/null or bit bucket.

### DNS filtering

Advertising can be blocked by using a DNS server which is configured to block access to domains or hostnames which are known to serve ads by spoofing the address. Users can choose to use an already modified DNS server or set up a dedicated device running adequate software such as a Raspberry Pi running Pi-hole themselves. Manipulating DNS is a widely employed method to manipulate what the end-user sees from the Internet but can also be deployed locally for personal purposes. China runs its own root DNS and the EU has considered the same. Google has required their Google Public DNS be used for some applications on its Android devices. Accordingly, DNS addresses/domains used for advertising may be extremely vulnerable to a broad form of ad substitution whereby a domain that serves ads is entirely swapped out with one serving more local ads to some subset of users. This is especially likely in countries, notably Russia, India and China, where advertisers often refuse to pay for clicks or page views. DNS-level blocking of domains for non-commercial reasons is already common in China.

### Recursive Local VPN

On Android, apps can run a local VPN connection with its own host filtering ability and DNS address without requiring root access. This approach allows ad blocking app to download ad blocking host files and use them to filter out ad networks throughout the device. AdGuard, Blokada, DNS66, and RethinkDNS are few of the popular apps which accomplish ad blocking without root permission. The ad blocking is only active when the local VPN is turned on, and it completely stops when the VPN connection is disconnected. The convenience makes it easy to access content blocked by anti-adblock scripts.
This approach optimizes battery usage, reduces internet slowdown caused by using external DNS or VPN ad blocking and needs overall less configuration.

### Hardware devices

Devices such as AdTrap or Pi-hole use hardware to block Internet advertising. Based on reviews of AdTrap, this device uses a Linux Kernel running a version of PrivProxy to block ads from video streaming, music streaming, and any web browser, while PiHole acts as a local DNS to block advertisement servers, stopping connected devices from showing most ads. Another such solution is provided for network-level ad blocking for telcos by Israeli startup Shine.

### By external parties and internet providers

Internet providers, especially mobile operators, frequently offer proxies designed to reduce network traffic. Even when not targeted specifically at ad filtering, these proxy-based arrangements will block many types of advertisements that are too large or bandwidth-consuming, or that are otherwise deemed unsuited for the specific internet connection or target device. Many internet operators block some form of advertisements while at the same time injecting their own ads promoting their services and specials.

## Economic consequences for online business

Some content providers have argued that widespread ad blocking results in decreased revenue to a website sustained by advertisements and e-commerce-based businesses, where this blocking can be detected.

## Business models

Tools that help block ads have to work on different business models to stay in operation:
* Free and open source: Several tools work under a FOSS model, powered by community contributions and donations, e.g. uBlock Origin.
* Whitelisting: Some companies maintain a whitelist of websites that allow "acceptable ads" in exchange for a share of ad revenue.
* Subscription/Upfront: Some companies offer a subscription or upfront payment model for adblocking tools, e.g. Wipr.
* Freemium: Some companies offer some level of service for free while charging for additional features, e.g. AdGuard.

## Response from publishers
### Countermeasures

Some websites have taken countermeasures against ad blocking software, such as attempting to detect the presence of ad blockers and informing users of their views, or outright preventing users from accessing the content unless they disable the ad blocking software, whitelist the website, or buy an "ad-removal pass". There have been several arguments supporting and opposing the assertion that blocking ads is wrong. Indeed, there is evidence to show that these countermeasures may hurt a website's SEO performance, as users unwilling to turn off their AdBlock may instead go to a competitor's website listed in the search results. Due to the little amount of time the user spends on the website, and the greater time spent on a competitor's, search engines may view the webpage less favourably and reduce its search ranking. The back-and-forth elevation of technologies used for ad-blocking and countering ad-blocking have been equated to an "ad blocking war" or "arms race" between all parties.
It has been suggested that in the European Union, the practice of websites scanning for ad blocking software may run afoul of the E-Privacy Directive. This claim was further validated by IAB Europe's guidelines released in June 2016 stating that there indeed may be a legal issue in ad blocker detection. While some anti-blocking stakeholders have tried to refute this it seems safe to assume that Publishers should follow the guidelines provided by the main Publisher lobby IAB.
In August 2017, a vendor, Admiral, of such counter-measures issued a demand under section 1201 of the U.S. Digital Millennium Copyright Act, to demand the removal of a domain name associated with their service from an ad-blocking filter list. The vendor argued that the domain constituted a component of a technological protection measure designed to protect a copyrighted work, and thus made it a violation of anti-circumvention law to frustrate access to it.
In September 2023, after a period of testing that began in May 2023, the American video hosting site YouTube began launching countermeasures at viewers with adblocker software running when viewing videos. A popup message appears warning the user is breaking the terms of service and may experience blocked viewing after three videos unless they whitelist the site, or purchase YouTube Premium. This sparked extreme controversy and backlash across the YouTube communities. In October 2023, privacy advocate Alexander Hanff filed a criminal complaint against YouTube under Irish jurisdiction due to its ad blocking detection script, which is believed to violate European Union privacy laws. In June 2024, YouTube began experimenting with server-side ad insertion, which consists of embedding ads directly into video streams, making automatic blocking significantly more difficult.

### Alternatives

As of 2015, advertisers and marketers look to involve their brands directly into the entertainment with native advertising and product placement (also known as brand integration or embedded marketing). An example of product placement would be for a soft drink manufacturer to pay a reality TV show producer to have the show's cast and host appear onscreen holding cans of the soft drink. Another common product placement is for an automotive manufacturer to give free cars to the producers of a TV show, in return for the show's producer depicting characters using these vehicles during the show.
Some digital publications turned to their customers for help as a form of tip jar. For example, The Guardian is asking its readers for donations to help offset falling advertising revenue. According to the newspaper's editor-in-chief, Katharine Viner, the newspaper gets about the same amount of money from membership and donations as it does from advertising. The newspaper considered preventing readers from accessing its content if usage of ad-blocking software becomes widespread, but so far it keeps the content accessible for readers who employ ad-blockers.
A new service called Scroll, launched in January 2020, worked with several leading website publishers to create a subscription model for ad-free browsing across all supported websites. Users would pay Scroll directly, and portions of the subscription fees are doled out to the websites based on proportional view count.