Skip to content

Add Windows workaround for Chrome extension bridge connection failure#34789

Closed
cruzlauroiii wants to merge 2 commits intoanthropics:mainfrom
cruzlauroiii:fix/windows-chrome-bridge-fallback
Closed

Add Windows workaround for Chrome extension bridge connection failure#34789
cruzlauroiii wants to merge 2 commits intoanthropics:mainfrom
cruzlauroiii:fix/windows-chrome-bridge-fallback

Conversation

@cruzlauroiii
Copy link
Copy Markdown

@cruzlauroiii cruzlauroiii commented Mar 16, 2026

Summary

  • Adds scripts/fix-windows-chrome.ps1 — PowerShell script that patches cli.js and chrome-native-host.bat
  • Adds patches/cli.js.patch — exact diff disabling _Oz() bridge URL resolver
  • Adds patches/chrome-native-host.bat — routes native host through Node.js + patched cli.js
  • Adds patches/README.md — full version and hash documentation

Problem

When tengu_copper_bridge is enabled server-side (Max subscribers), _Oz() returns wss://bridge.claudeusercontent.com, forcing the MCP server to use BridgeClient (y61) instead of the local socket pool (pzA). The bridge fails to connect, with no fallback to local sockets, causing "Browser extension is not connected" on every tool call.

The local named pipe (\.\pipe\claude-mcp-browser-bridge-{user}) works perfectly.

Source Versions

File Version Original SHA-256
cli.js 2.1.76 (build 2026-03-14T00:12:49Z) 38b8fd29d0817e5f75202b2bb211fe959d4b6a4f2224b8118dabf876e503b50b
Chrome extension 1.0.61 (Manifest V3) service-worker: fa55ffbb749310582e7aab3b5154fc899bdfcf65c92ed916f8b05834b6ccddf9
Patched SHA-256
cli.js 6ea2a57ddd49c3f0869e77e027f3de0c2116c390a0d338963f70bec9b92b537c
Chrome extension Not modified — bug is in CLI, not extension

Extension ID: fcoeoabgfenejglbffodgkkbkcdhcgfn

The Patch (1 line)

-function _Oz(){if(!w8("tengu_copper_bridge",!1))return;...
+function _Oz(){return;if(!w8("tengu_copper_bridge",!1))return;...

Adds return; at the start of _Oz(), making it always return undefined. This prevents bridgeConfig from being set, forcing Xd1() to use the local socket pool instead of BridgeClient.

Test plan

  • Verified local named pipe accepts connections and returns Chrome tab data
  • Instrumented dzA — confirmed unpatched uses y61 (BridgeClient), patched uses pzA (local pool)
  • Patched MCP server returns real tabs via tabs_context_mcp
  • -Uninstall flag reverts the patch
  • Test on fresh Windows install

Fixes #34788
Related: #23828, #33778, #32825, #26241

When the tengu_copper_bridge feature flag is enabled server-side,
the --claude-in-chrome-mcp subprocess uses a WebSocket bridge instead
of the local named pipe, causing "Browser extension is not connected"
errors on Windows.

This script patches the npm-installed cli.js to disable the bridge
and routes the native messaging host through Node.js, forcing local
socket mode which works correctly.

Fixes #34788
@cruzlauroiii
Copy link
Copy Markdown
Author

Closing alongside #34788 (duplicate of #33778, #26241, #32825). The workaround script and patched files are available in the branch cruzlauroiii:fix/windows-chrome-bridge-fallback for anyone who needs them.

- patches/cli.js.patch: exact diff disabling _Oz() bridge URL resolver
- patches/chrome-native-host.bat: routes native host through Node.js
- patches/README.md: version, SHA-256 hashes, and extension metadata

Source versions:
  cli.js v2.1.76 (build 2026-03-14T00:12:49Z)
    original: 38b8fd29d0817e5f75202b2bb211fe959d4b6a4f2224b8118dabf876e503b50b
    patched:  6ea2a57ddd49c3f0869e77e027f3de0c2116c390a0d338963f70bec9b92b537c
  Chrome extension v1.0.61 (fcoeoabgfenejglbffodgkkbkcdhcgfn)
    service-worker: fa55ffbb749310582e7aab3b5154fc899bdfcf65c92ed916f8b05834b6ccddf9

Fixes #34788
@cruzlauroiii cruzlauroiii closed this by deleting the head repository Mar 16, 2026
@cruzlauroiii
Copy link
Copy Markdown
Author

Superseded by plugin-based approach: the bridge fix is now packaged as a Claude Code plugin in plugins/bridge-fix/ with proper install/uninstall scripts. See PR #35683 for the new plugin approach and https://github.com/anthropics/claude-code/pull/new/plugin/bridge-fix for the bridge-fix plugin specifically.

The plugin includes:

  • bridge-fix.cjs — preload module
  • scripts/install.js — automated cli.js patcher with install/uninstall support
  • Proper plugin metadata and documentation

This makes the fix portable across versions and easier to maintain than raw patch files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Claude-in-Chrome: tengu_copper_bridge feature flag forces WebSocket bridge, breaks local socket on Windows

2 participants