Content blocking is the practice of preventing some part of a web page from being loaded, executed or displayed. The blocked part can be an advertisement, a tracking script, a video embed, a font, a whole domain or a single element inside a page. What makes the term broad is that blocking can happen at several layers and in two fundamentally different ways. Request blocking stops the browser from fetching a resource at all, so that particular request does not reach its destination. Cosmetic filtering lets the resource load but hides it from view. Both produce a cleaner page; request filtering directly limits the requests third parties receive. Understanding the layer and the method behind a given blocker is the difference between knowing that an ad is invisible and knowing that an ad network received no request.
Request Filtering and Page Changes
Request blocking works at the moment the browser is about to fetch something. Modern extension platforms expose this through declarative rule sets: an extension ships a list of rules, each with a condition such as a URL pattern, a resource type and an initiator domain, and an action such as block, redirect, allow or modify headers. MDN's documentation for the declarativeNetRequest API describes how the browser itself evaluates these rules against outgoing requests without notifying the extension about each one, reducing interception overhead and the need to expose requests to extension code. An extension with additional permissions may still observe browsing through other APIs. Apple's content blocker format for Safari works on the same principle, with triggers based on URL filters, resource types and load type, and actions including block and block-cookies.
Cosmetic filtering operates after the page exists. A rule names a CSS selector, and the blocker injects a style that sets matching elements to display none, or removes them from the DOM. Safari's format calls this action css-display-none, and filter lists for other blockers contain thousands of such selectors for placeholder boxes, overlays and sponsored labels. The resource behind the element has usually been downloaded by that point. Cosmetic rules are therefore about layout and attention, not about preventing data from flowing, and a blocker that relied on them alone would leave tracking intact while making the page look clean.
Browser, DNS and Network Blocking
The same goal can be pursued at three different layers, each with distinct visibility and granularity.
| Layer | How it decides | Can block a single element | Can see the full URL | Typical example |
|---|---|---|---|---|
| Browser | Rules on URL, resource type, initiator, selectors | Yes | Yes | Extension rule sets, built-in tracking protection |
| DNS | Domain name in the lookup | No | No | Filtering resolver returning a null address |
| Network | Address, port, domain or inspected content | Rarely | Only without encryption or with interception | Firewall, gateway or proxy policy |
Browser-level blocking has the most context. It knows whether a script was requested by the top-level page or by an embedded frame, what type of resource it is and, for cosmetic rules, which page elements match a selector, so it can block one script on a domain while allowing another. Firefox's built-in tracking protection, for instance, blocks content loaded from domains on a list of known cross-site trackers while leaving the rest of the page alone.
DNS blocking sees only the hostname being resolved. Cloudflare's filtering resolvers illustrate the mechanism: when a queried domain is classified as malicious, the resolver returns the address 0.0.0.0 instead of the real one, preventing an ordinary connection using that DNS answer. This applies to every application on the device that uses that resolver, including apps that no extension could reach, but it cannot distinguish an analytics script from a legitimate API on the same domain. A firewall or gateway can apply network rules to multiple devices, although coverage depends on which traffic passes through it. Encrypted connections hide paths and content from both of these layers, which is why they operate mostly on names and addresses.
Why Blocking Breaks Pages
Pages are written on the assumption that their resources load. Mozilla's documentation on tracking protection points out that if other parts of a site depend on a tracker being loaded, those parts break too; a link-click handler that waits for an analytics callback before navigating will never navigate if the analytics script was blocked. Layout can shift where a blocked frame was expected to occupy space. Consent dialogs, payment widgets and login buttons served from third-party domains can disappear when a domain-level rule is too broad.
Tracker blocking lists try to minimise this by targeting domains and paths used only for tracking, and browsers log blocked requests to the developer console so that developers can see what happened. Users typically get a per-site switch to disable protection where a page fails. Broader rules increase the risk of false positives; an exception restores functionality at the cost of allowing the excepted traffic.
Blocking vs Privacy Protection and Access Control
Content blocking is often marketed as privacy protection, and request-level tracker blocking does reduce what third parties observe. It is not the whole of privacy, though. A first-party site can still observe requests and interactions its own code collects, fingerprinting scripts served from the first-party domain are hard to distinguish from functional code, and cosmetic rules reveal nothing about what was transmitted. Equally, content filtering by a network administrator is often about policy rather than privacy: a school or company blocks categories of sites to enforce acceptable use, and the filter may log the attempt rather than hide it.
Access control runs in the opposite direction. A site that refuses visitors from a region or without a login is restricting access to its own content; a blocker on the user's side is restricting what the user's device will fetch or show. The two are frequently confused in discussions about what blocking tools can do. A content blocker makes a page lighter and quieter; it does not grant entry to content that a server declines to serve.
Practical Limits
Blocking depends on recognising the thing to block. Filter lists lag behind new domains, and some sites serve ads and trackers from the same hostnames as essential content, sometimes through the first-party domain itself, which domain-based rules cannot separate. Rule-set platforms impose limits on the number of static and dynamic rules an extension may register, so list maintainers must prioritise. Resolver-only filtering may be bypassed when an application uses a different resolver, unless the network enforces the policy elsewhere. And servers can detect that an expected resource never loaded and respond by withholding content or showing a notice. None of this makes blocking ineffective; it means that a given blocker's effect should be stated precisely, in terms of which requests it stops at which layer, rather than as a general promise of a tracker-free web.