Dev.to AI πŸ€– Ai πŸ‘ 1 πŸ“– 2 min read

How I Built a Pure Client-Side Cross-Tab AI Bridge on Manifest V3 (Zero Backend Relays)

Most AI browser agents today work in one of two ways: They spin up a remote cloud browser (expensive, blocked by corporate SSO/2FA). They pipe your active webpage DOM through their own backend servers before hitting an

How I Built a Pure Client-Side Cross-Tab AI Bridge on Manifest V3 (Zero Backend Relays)

Most AI browser agents today work in one of two ways:

  1. They spin up a remote cloud browser (expensive, blocked by corporate SSO/2FA).
  2. They pipe your active webpage DOM through their own backend servers before hitting an LLM API (huge privacy red flag, plus you have to pay for extra API keys).

I wanted something radically simpler and 100% private: use the web AI chats I already have open (ChatGPT, Claude, DeepSeek, Gemini, Kimi) to inspect and control another open, logged-in tab locallyβ€”with zero servers.

That's why I built TabWeaver (MIT licensed, zero build step, pure Manifest V3).

TabWeaver Cross-Tab Selector

The Core Bottleneck: Raw HTML Destroys Token Budgets

If you grab document.documentElement.outerHTML from modern web apps like Google Analytics, Jira, or GitHub, you easily end up with 50,000+ characters of SVG paths, inline scripts, hidden nodes, and CSS noise.

To solve this natively in the browser, I wrote a Viewport & Overlay-Aware DOM Distiller (dom-distiller.js):

  1. Top-Layer Priority: Active modals, dialogs, and popovers get top extraction priority so search overlays aren't buried under static headers.
  2. Interactive Element Indexing: Visible buttons, links, inputs, and selects receive lightweight data-ext-elem-id anchors.
  3. Aggressive Noise Stripping: Tracking scripts, empty anchors, and hidden trees are stripped inside the client sandbox before serializationβ€”cutting token usage by 80%+.

How the Dual-Tab Handshake Works

  1. Mention to Link: Type # or @ inside any of the 18 supported web AI composers. An inline tab picker pops up showing all open tabs in your current window.
  2. Visual Proof: The moment a target tab connects, TabWeaver renders a subtle Cyber Breathing Halo along the viewport border so you always know which tab is active.
  3. Structured Action Loop: The AI outputs compact JSON actions (click, fill, select, scroll, extract, navigate, finish), executed locally via chrome.scripting and action-executor.js.

Breathing Halo Visual Feedback

Why "Logged-In Web Apps" Is the Sweet Spot

Because execution lives strictly inside your authenticated local Chrome profile:

  • You can summarize and analyze Google Analytics 4, Jira, Gmail, or internal dashboards behind logins without exposing cookies to any external relay.
  • You don't pay a cent for extra API wrappersβ€”it runs directly on your existing ChatGPT / Claude / DeepSeek web session.

Try It & Inspect the Code

Would love to hear how you handle DOM distillation or Manifest V3 cross-tab messaging in your extensions!

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.