ish-bot-chrome-network-extension: The Chrome Extension That Lets Nothing Load Unless It Says So

A tiny Manifest V3 bot shim blocks every main-frame navigation, then whitelists selected tabs with higher-priority session rules.

7 min read • View on GitHub • More from dashn9

A browser window is staged like a customs checkpoint, with several tabs waiting behind a locked gate. One tab receives a stamped pass while the others remain outside, showing that access is granted selectively rather than by default.
The extension turns tab loading into an admission problem: no pass, no page.
Key Takeaways

A browser that starts locked

Most automation stacks open the page first and enforce policy later. This repo flips that order. It installs a blanket block on main_frame navigations, so a new tab does not get to load anything unless a higher-priority rule says that tab is allowed.

const GLOBAL_BLOCK_ID = 1;

async function lockBrowser() {
  await chrome.declarativeNetRequest.updateSessionRules({
    addRules: [{
      id: GLOBAL_BLOCK_ID,
      priority: 1,
      action: { type: 'block' },
      condition: {
        resourceTypes: ['main_frame']
      }
    }]
  });
}

function allowTab(tabId) {
  return chrome.declarativeNetRequest.updateSessionRules({
    addRules: [{
      id: tabId,
      priority: 2,
      action: { type: 'allow' },
      condition: {
        tabIds: [tabId],
        resourceTypes: ['main_frame']
      }
    }]
  });
}

That is the whole trick in miniature. A low-priority session rule says no to every main-frame request, then a tab-scoped rule with a higher priority says yes to one specific tab. The browser is no longer a neutral surface. It is an access-controlled perimeter.

This is not ad blocking

Ad blockers trim unwanted content inside a page. This extension decides whether the page exists at all. The repo is correspondingly small: a manifest, a background service worker, and an isolated content script placeholder. That simplicity is not a limitation. It is the point.

Two overlapping rule cards are shown in extreme close-up. The lower card is a global block notice, and the upper card is a brighter allow notice labeled with a tab-specific identifier, making the override relationship obvious.
Chrome's rule priority system becomes the entire product once the allow rule outranks the block rule.

The rule engine is the product

The elegance here is in the API choice. The extension uses session rules, not permanent rules, so the browser returns to default-deny when the session ends. It also uses the tab ID as the rule ID, which makes each allow rule easy to target and remove later. That is the kind of small design decision that keeps a control plane from turning into a mess.

The real architecture is a tab-admission state machine, not a generic filter.

A stopwatch hangs over a newly created tab while a thin barrier holds back the first navigation request. A second later, a permission line cuts through and the request moves forward, showing that timing is part of the control logic.
The one-second blackout suggests synchronization pressure between tab creation, service worker wakeup, and the first request.

Why the 1-second blackout matters

The timeout is the tell. If the allow rule appeared immediately, this would be a simple toggle. The one-second gap suggests the author is managing timing across tab creation, service worker wakeup, and the first navigation event. That makes the repo feel less like a filter and more like a race-condition workaround with opinions.

What’s actually happening under the hood is something much stranger and more significant: a local AI agent that physically controls your web browser, navigates authenticated sessions, clicks buttons, fills forms, and reports back to you over Telegram while you’re away from your desk.

Kristopher Dunham, Author, Medium · OpenClaw architecture

What it beats, and what it does not

Compared with general browser automation, this pattern moves earlier in the stack. It does not try to type faster or click better. It decides who gets to load in the first place.

ApproachControl pointAuth/session modelComplexityBest use case
This repoMain-frame network admissionTab-scoped session rulesLowGranting or revoking page loads themselves
Selenium or PuppeteerScript-driven DOM and page flowLogin happens inside the automation flowMedium to highGeneral browser workflows and test automation
CDP relay agentsRemote control of a live browserUses the host browser's existing cookies and stateMediumPowerful control of a real authenticated session
Profile-copy agentsLaunch from a copied browser profileCloned cookies and local storageMediumFast startup with familiar login state

The larger lesson

The big idea is not that Chrome can be blocked. It is that browser agents are moving from DOM choreography to session governance. Whoever controls the first request controls the timing of login, the shape of the session, and the blast radius of automation. That is why this repo matters even though it fits in a handful of files.