[BUG] Chrome extension reconnect fails due to CSP blocking inline script on claude.ai

Resolved 💬 8 comments Opened Mar 14, 2026 by knobo Closed Apr 26, 2026

Description

The /chrome reconnect flow fails because an inline script on the claude.ai reconnect page is blocked by the site's own Content Security Policy (CSP).

When running /chrome in Claude Code CLI, a new Chrome tab briefly opens on claude.ai, shows a CSP error, and immediately closes. The connection between CLI and Chrome extension is never established.

Environment

  • Claude Code: v2.1.76
  • Chrome extension: v1.0.61 (Claude in Chrome Beta)
  • Chrome: 145.0.7632.159
  • OS: Ubuntu Linux (X11)

Steps to reproduce

  1. Install Claude in Chrome extension from Chrome Web Store
  2. Log into claude.ai in Chrome
  3. Start claude --chrome
  4. Run /chrome and select "Reconnect extension"
  5. Observe: a new tab opens briefly on claude.ai, then closes
  6. Result: "Browser extension is not connected"

Error details

The DevTools console on the reconnect tab shows:

Executing inline script violates the following Content Security Policy
directive 'script-src' 'self' a-cdn.claude.ai assets.claude.ai
assets-proxy.anthropic.com a-cdn.anthropic.com s-cdn.anthropic.com
https://js.intercomcdn.com https://widget.intercom.io https://snippet.maze.co
https://www.googletagmanager.com https://js.hs-scripts.com https://js.stripe.com
https://accounts.google.com/gsi/client https://maps.googleapis.com
https://maps.gstatic.com 'sha256-...' 'sha256-...' 'sha256-...'
'wasm-unsafe-eval'. Either the 'unsafe-inline' keyword, a hash ('sha256-...'),
or a nonce ('nonce-...') is required to enable inline execution.
The action has been blocked.

Also logged:

[MCP] Pretending GDrive is MCP: gcal_and_gmail_mcp is enabled but mcp_gdrive is not

Debugging performed

Extensive debugging confirmed:

  • Chrome extension works standalone (can automate browser via claude.ai side panel)
  • Native messaging host works (accepts connections, forwards messages between socket and Chrome — confirmed via strace)
  • CLI MCP server connects (claude-in-chrome MCP · ✔ connected in /plugin view)
  • The WebSocket bridge is used (CLI connects to wss://bridge.claudeusercontent.com, not local socket)
  • Root cause: The reconnect tab's inline script is blocked by CSP, preventing the authentication handshake from completing

Expected behavior

The /chrome reconnect flow should successfully establish a connection between Claude Code CLI and the Chrome extension.

Workaround

None found. Tested: reinstalling extension, clearing extension storage, new Chrome profile, restarting Chrome/machine, re-login via /login, purging all native messaging host configs and reinstalling.

View original on GitHub ↗

This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗