Building a Route-Keyed Dev Browser That Coding Agents Can Actually Drive
Why read-side URL spoofing breaks modern frameworks, how write-only interception fixes it, and how agents inspect localhost apps beside their terminals.
When an AI coding agent modifies a web application, unit tests only prove part of the contract. You still have to open the running app, click through the UI, check console errors, inspect computed CSS, and verify responsive layouts—often from a remote laptop or phone where localhost:5173 on the dev workstation is unreachable.
Between February 19 and March 19, 2026 (910 commits across v7.3.0 to v8.7.0), we built the Dev Browser directly into tlbx and wired it to a deterministic agent automation bridge, while completing cross-platform code signing and Linux ARM64 releases.
Why Naive Reverse Proxies Break SPAs and Blazor
The first version of the in-app web preview (v7.3.0) immediately exposed every hard edge case of proxying arbitrary local development servers into an iframe on a single HTTPS port:
- Read-side spoofing fails silently in Chrome. Properties on
Location.prototypehaveconfigurable: false, so trying to fakelocation.hreffails while overridingdocument.baseURIsucceeds. Frameworks such as Blazor comparelocation.hrefagainstdocument.baseURIand crash their router when the two URL spaces disagree. - Rewriting WebSocket payloads corrupts binary protocols. Touching URL strings inside JSON or MessagePack SignalR frames requires re-encoding VarInt lengths and breaks binary streams.
- Cookie leakage across apps. Forwarding upstream cookies into the browser's main jar mixes session cookies between unrelated localhost apps and tlbx's own authentication cookie.
The Solution: Route-Keyed Write-Only Interception
Instead of faking read-side URLs, mt assigns every named preview a route prefix—/webpreview/{routeKey}/—and injects <base href="/webpreview/{routeKey}/"> plus a small write-only rewrite shim before page scripts execute:
| Layer | Behavior | Reason |
|---|---|---|
Read-side APIs (location.href, document.baseURI) |
Untouched; both reflect /webpreview/{routeKey}/... |
Frameworks compute relative routes consistently (currentUri - baseUri) |
Write-side APIs (fetch, XHR, WebSocket, EventSource, history.pushState, .src/.href) |
Prefixed automatically with /webpreview/{routeKey} |
Outgoing asset and API calls stay inside the preview proxy |
| WebSocket Relay | Relayed byte-for-byte with zero payload rewriting | SignalR, HMR, and binary sockets never corrupt |
| Upstream Cookies | Held in a server-side CookieContainer per preview |
HttpOnly cookies never touch client JS; tlbx auth cookies never leak upstream |
| Sandboxed Origin | Enforced via iframe sandbox + HTTP Content-Security-Policy: sandbox |
Preview documents execute in an opaque origin on the same HTTPS port—no extra firewall port needed |
Deterministic Agent Browser Control (v7.4–v7.8)
Opening a preview for a human was only half the goal. We wanted the coding agent in the adjacent terminal to verify its own work without spinning up an external headless browser that cannot see the user's logged-in preview state.
- Zero-permission screenshots (
v7.4.0): Replaced screen-capture APIs (which triggered browser permission prompts and red recording indicators) with an injectedhtml2canvasDOM capture helper loaded via a blob URL, paired with full DOM inspection (outline,attributes,css,console,proxylog). - Scoped preview identity (
v7.8.0/v8.3.0): Rather than broadcasting commands to "whichever iframe connected last," every docked or detached preview registers an explicit(sessionId, previewName, routeKey, previewId, previewToken)identity on/ws/browser. Agents target their own named preview deterministically and inspect real upstream proxy logs alongside console errors.
Shipping Trustworthy Native Binaries Across Platforms
In parallel with the Dev Browser, v7.5 through v8.7 hardened distribution across operating systems:
- Windows Authenticode signing (
v7.5.0/v7.6.0) and macOS code signing detection (v8.0.0) automated in CI so native binaries verify cleanly on user machines. - Linux ARM64 releases (
v8.5.0/v8.6.0) added first-class Raspberry Pi and ARM server support alongside Windows x64/x86, Linux x64, and macOS. - npm trial launcher (
v8.2.0) and official uninstall scripts (v8.7.0) completed the install/uninstall lifecycle while keeping native installs as the primary path.
Milestone Summary
- Commits in phase: 910 (
2026-02-19to2026-03-19) - Key tags:
v7.3.0,v7.6.0,v7.8.0,v8.2.0,v8.7.0 - Durable result: A single-port, route-keyed Dev Browser proxy that handles SPAs, Blazor, WebSockets, and agent inspection side-by-side with live terminals. See it in action on the coding-agent workflows page.