Title: Chrome Extension: CSP violation + connection to Claude Code fails Chrome is up to date Version 144.0.7559.110 (Official Build) (64-bit)

Resolved 💬 3 comments Opened Jan 29, 2026 by nattapoomsecond-cpu Closed Feb 2, 2026

Title:
Chrome Extension: CSP violation + connection to Claude Code fails
Chrome is up to date
Version 144.0.7559.110 (Official Build) (64-bit)

Body:
## Bug Description

The Claude Chrome extension has two issues:

  1. CSP violation blocks sidepanel from loading (inline script)
  2. Even after fixing CSP, connection to Claude Code still fails

## Error Messages

### CSP Error (in extension console):
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.
Context: sidepanel.html

### Connection Error:
Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.

## Root Cause (CSP Issue)

Inline scripts in sidepanel.html, options.html, and newtab.html (lines 8-27) violate Chrome's Manifest V3 CSP:

```html
<script>
// Set initial theme mode based on system preference
(function () { ... })();
</script>

Workaround Applied

Moved inline scripts to external file theme-init.js and replaced with:
<script src="/theme-init.js"></script>

This fixes the CSP error and allows the sidepanel to open, but connection to Claude Code still fails.

Environment

  • Claude Code version: 2.1.23
  • Extension version: 1.0.41
  • OS: Windows 11 (Build 22621)
  • Chrome version: [Add from chrome://version]

Native Messaging Setup

Verified native messaging host is configured correctly:

  • %LOCALAPPDATA%\Google\Chrome\User Data\NativeMessagingHosts\anthropic.claude_code.json exists
  • Extension ID matches: fcoeoabgfenejglbffodgkkbkcdhcgfn
  • Path points to correct claude.exe location

Steps to Reproduce

  1. Install Claude Chrome extension from Web Store
  2. Install Claude Code CLI v2.1.23
  3. Run /chrome command in Claude Code
  4. Sidepanel fails to load with CSP error
  5. After applying CSP fix, sidepanel opens but connection still fails

Expected Behavior

Extension sidepanel loads and connects to Claude Code.

Actual Behavior

  1. Without fix: Sidepanel fails to load (CSP error)
  2. With CSP fix: Sidepanel loads but connection to Claude Code fails

View original on GitHub ↗

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