Title: Chrome Extension: CSP violation + connection to Claude Code fails Chrome is up to date Version 144.0.7559.110 (Official Build) (64-bit)
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:
- CSP violation blocks sidepanel from loading (inline script)
- 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
- Install Claude Chrome extension from Web Store
- Install Claude Code CLI v2.1.23
- Run /chrome command in Claude Code
- Sidepanel fails to load with CSP error
- After applying CSP fix, sidepanel opens but connection still fails
Expected Behavior
Extension sidepanel loads and connects to Claude Code.
Actual Behavior
- Without fix: Sidepanel fails to load (CSP error)
- With CSP fix: Sidepanel loads but connection to Claude Code fails
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗