Bug Report: Claude in Chrome extension not connecting - CSP errors blocking extension scripts

Resolved 💬 6 comments Opened Jan 29, 2026 by ginko-ai Closed Mar 10, 2026

Bug Report: Claude in Chrome extension not connecting - CSP errors blocking extension scripts

GitHub Issue URL: https://github.com/anthropics/claude-code/issues/new?labels=bug,claude-in-chrome

---
Title

[BUG] Chrome extension v1.0.41 fails to connect - CSP blocks inline scripts in sidepanel.html (Windows)

Description

The Claude in Chrome browser extension fails to connect to Claude Code CLI. The extension's sidepanel
JavaScript crashes due to Content Security Policy violations before it can attempt native messaging
connection.

Environment

  • OS: Windows 11 (Build 26200.7623)
  • Claude Code version: 2.1.23
  • Chrome extension version: 1.0.41
  • Chrome version: (add your version from chrome://settings/help)

Symptoms

  1. Running claude --chrome shows no errors
  2. /chrome command shows extension as disconnected
  3. All mcp__claude-in-chrome__* tools return "Browser extension is not connected"
  4. Extension sidepanel opens but fails to function
  5. Native messaging host is never invoked (verified via logging)

Console Errors (from extension DevTools)

Executing inline script violates the following Content Security Policy directive:
'script-src 'self''. Either the 'unsafe-inline' keyword, a hash
('sha256-kFwyFWA0myfqRcE5y2d5UX8g0o2QFHSmCz1gWSW0xpk='), or a nonce ('nonce-...')
is required to enable inline execution. The action has been blocked.
[sidepanel.html:8]

Loading the script 'https://cdn.segment.com/next-integrations/actions/amplitude-plugins/...'
violates the following Content Security Policy directive: "script-src 'self'".
The action has been blocked.
[Main-BlBvQSg-.js:20]

Uncaught (in promise) Error: Could not establish connection.
Receiving end does not exist.
[sidepanel-CZxLGvD6.js:12]
[mcpPermissions-D8RnuVb0.js:3]

Unchecked runtime.lastError: Debugger is not attached to the tab with id: XXXXXX

Troubleshooting Steps Completed

  • ✅ Verified Chrome extension installed and enabled
  • ✅ Verified Claude Code version 2.1.23 (above required 2.0.73)
  • ✅ Verified extension version 1.0.41 (above required 1.0.36)
  • ✅ Restarted Chrome completely (killed all processes)
  • ✅ Restarted Claude Code with --chrome flag
  • ✅ Ran /chrome and selected "Reconnect extension"
  • ✅ Verified native messaging host manifest exists and is correctly configured
  • ✅ Verified registry key points to correct manifest
  • ✅ Removed conflicting Claude Desktop native messaging host registration
  • ✅ Added logging to native host batch file - confirmed it is never invoked
  • ✅ Service worker console shows no errors (clean)
  • ✅ Sidepanel console shows CSP errors above

Native Messaging Host Configuration

Registry: HKCU\Software\Google\Chrome\NativeMessagingHosts\com.anthropic.claude_code_browser_extension

Manifest: C:\Users\genes\AppData\Roaming\Claude
Code\ChromeNativeHost\com.anthropic.claude_code_browser_extension.json
{
"name": "com.anthropic.claude_code_browser_extension",
"description": "Claude Code Browser Extension Native Host",
"path": "C:\\Users\\genes\\.claude\\chrome\\chrome-native-host.bat",
"type": "stdio",
"allowed_origins": [
"chrome-extension://fcoeoabgfenejglbffodgkkbkcdhcgfn/"
]
}

Root Cause Analysis

The extension's sidepanel.html contains inline scripts that Chrome's Manifest V3 CSP blocks. This prevents
the extension's JavaScript from executing, which means:

  1. The sidepanel UI partially loads but can't function
  2. The native messaging connection is never attempted
  3. The chrome.runtime.connectNative() call never happens

Expected Behavior

Extension should connect to Claude Code CLI and mcp__claude-in-chrome__* tools should function.

Related Issues

  • #20298 - Chrome extension not connecting to native messaging host
  • #14894 - Native Messaging Host installation issues
  • #20341 - Native messaging host conflicts

View original on GitHub ↗

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