scalpel@labs: ~/glossary/blocked-request-count.mdx5 sections

The Blocked Count, and Why It Is Honest

The blocked count is the number of requests Chrome stopped on the current page. Scalpel reads it with getMatchedRules for the active tab, only when you open the popup. It does not watch other tabs, so cross-page totals under-count by design.

extension: Scalpel Ads Blockerupdated: 2026-08-14read_time: 3 min
less blocked-request-count.mdx

Why it matters

You want to know whether Scalpel is working. A number on the badge ("247 blocked") makes it feel real. But an honest count matters more than an impressive count. Most blockers show inflated numbers because they watch every tab, cache counts, and add them up into a running global total that grows all day.

Scalpel counts only what it can honestly measure: requests on the page you're looking at, right now, when you open the popup. That's a smaller number, but it's true. No background surveillance, no fabricated tallies. The honesty is the point.

How it works

When you open the Scalpel popup, the extension calls chrome.declarativeNetRequest.getMatchedRules() on the active tab. Chrome tells it exactly how many requests its own rules blocked on that page. Scalpel displays that number.

This call requires a user gesture, you clicking the popup, so no background counting happens. Scalpel does not poll or watch. It only counts when you ask.

The number shown is always for the current page. If you switch tabs, the count updates to show the active tab's blocked requests. If you have ten tabs open with ads, but you only opened the popup on one of them, Scalpel reports only that one's count. The other nine are unmeasured.

This is intentional. getMatchedRules is exact but expensive. Polling every tab constantly would drain the battery and violate the principle of least access. Counting only the page you're looking at keeps the extension light and private.

What does not matter

The blocked count does not represent your total daily ad load. If you browse for eight hours, Scalpel does not add up a global total of "18,000 ads blocked today." It can't, because it doesn't watch unmeasured tabs. So if you have five news sites open in background tabs and never check Scalpel on those sites, you'll never know how many adverts they blocked.

That under-count is a feature, not a bug. It keeps Scalpel from needing to log and cache every blocked request from every tab. No logging means no list to leak if Scalpel's storage gets compromised.

The count does not break down by type. Scalpel tells you "47 requests blocked" but doesn't say "30 adverts and 17 trackers." That detail would require deeper inspection of each request, which adds overhead and complexity.

Some builds of Scalpel (like the GitHub dev build) do keep a cache and log every tab's blocks for the session. But the store version, the one most people use, counts only the page you're on, because that's the version that respects your privacy.

Code example

When you open the popup, this is what happens:

// Get the active tab
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
  const tabId = tabs[0].id;
  
  // Count what was blocked on this tab only
  chrome.declarativeNetRequest.getMatchedRules(
    { tabId: tabId },
    (result) => {
      // result.rulesMatchedInfo is an array of matched rules
      const blockedCount = result.rulesMatchedInfo.length;
      console.log(`Blocked ${blockedCount} requests on this page`);
      
      // Display it
      displayBadge(blockedCount);
    }
  );
});

The activeTab permission lets the extension read the active tab's ID, but doesn't let it see background tabs. So the query only returns data for the one tab you're looking at. That's by design.

If Scalpel tried to run this on every tab in the background, it would:

  1. Need broader permissions (all tabs, not just active).
  2. Need to cache results and log every blocked request.
  3. Drain battery polling constantly.
  4. Compromise privacy by tracking what you browse.

The current approach trades some convenience (you don't see a global daily count) for privacy and efficiency.

How Scalpel Ads Blocker shows it

Open the Scalpel popup and the main number is the blocked count for the current page. It updates every time you open the popup on a different page. If the count is zero, either that page doesn't load ads or blocking is off for that site.

The badge on the toolbar icon shows the same count, so you can see it without opening the popup. A single glance tells you whether this page was targeted by ad networks.

If you switch to a tab you've never opened Scalpel on, the popup shows no count: it only reads the active tab once, when you click the icon.

Sources