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
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 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).
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):
- Top-Layer Priority: Active modals, dialogs, and popovers get top extraction priority so search overlays aren't buried under static headers.
-
Interactive Element Indexing: Visible buttons, links, inputs, and selects receive lightweight
data-ext-elem-idanchors. - 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
-
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. - 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.
-
Structured Action Loop: The AI outputs compact JSON actions (
click,fill,select,scroll,extract,navigate,finish), executed locally viachrome.scriptingandaction-executor.js.
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
- β GitHub (MIT, pure JS): https://github.com/zpzxgcr/TabWeaver
- π Chrome Web Store: https://chromewebstore.google.com/detail/tabweaver-cross-tab-ai-br/allofpdkpijflgipdonjfgicgeajelen
- π Website & Interactive Demo: https://zpzxgcr.github.io/TabWeaver/
Would love to hear how you handle DOM distillation or Manifest V3 cross-tab messaging in your extensions!
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.
