[BUG] Screenshot and JavaScript tools fail with "Cannot access a chrome-extension:// URL of different extension"

Status Open
Reported on v2.0.76
Maintainer reply None cached
Activity 16 comments · opened Jan 4, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Bug: Screenshot and JavaScript tools fail with "Cannot access a chrome-extension:// URL of different extension"

Environment

  • Platform: macOS Darwin 24.6.0
  • Claude Code: (run claude --version to confirm)
  • Chrome Extension: Claude in Chrome (verify version in chrome://extensions)

Issue

The screenshot and javascript_tool MCP tools consistently fail with:
Error capturing screenshot: Cannot access a chrome-extension:// URL of different extension

Meanwhile, read_page, navigate, wait, and find tools work correctly.

What Works vs. What Fails

| Tool | Uses | Status |
|-----------------|---------------------|----------|
| read_page | Accessibility tree | ✅ Works |
| navigate | Chrome tabs API | ✅ Works |
| wait | Timer | ✅ Works |
| find | Accessibility tree | ✅ Works |
| screenshot | chrome.debugger API | ❌ Fails |
| javascript_tool | chrome.debugger API | ❌ Fails |

Troubleshooting Attempted

  1. ❌ Closed Next.js debugger/DevTools - no change
  2. ❌ Full Chrome restart (Cmd+Q) - no change
  3. ❌ Created fresh tabs - no change
  4. ❌ Tried deployed HTTPS URL instead of localhost - no change

What Should Happen?

Chrome extension should be able to take screenshots and execute js

Error Messages/Logs

The screenshot and javascript_tool MCP tools consistently fail with:
  
Error capturing screenshot: Cannot access a chrome-extension:// URL of different extension

Steps to Reproduce

Steps to Reproduce

  1. Start Claude Code with claude
  2. Verify Chrome extension connected via /mcp
  3. Navigate to any URL (tested both localhost:3001 and https://pockla-app-team-beta.vercel.app)
  4. Attempt screenshot or javascript_tool action
  5. Error occurs regardless of URL

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.0.76

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

15 Comments

cottom · 7 months ago

same error

Good, tab 1232384027 is working. Let me fill and test the sign-up form:
  ⎿  Error: Failed to execute JavaScript: Cannot access a chrome-extension:// URL of different extension
Colmea · 7 months ago

I had the same issue and it (looks like) it was caused by a Chrome extension (password manager in my case).
Try to disable all your extensions and see if it's working

alexriftagentic · 7 months ago

I fixed this:

  1. Chrome → View → Developer → Allow JavaScript from Apple Events
  2. Refresh/re-navigate any tabs that were open before enabling the setting - old tabs don't pick up the permission change
petekp · 7 months ago
I fixed this: 1. Chrome → View → Developer → Allow JavaScript from Apple Events 2. Refresh/re-navigate any tabs that were open before enabling the setting - old tabs don't pick up the permission change

This didn't work for me, unfortunately.

h-projects7364 · 7 months ago

One way that worked for me was just disable all other extensions

petekp · 7 months ago

I suspect having a non-Chrome chromium-based browser open also causes issues. I use Dia and I noticed that new Dia windows were spawning to dia://new-tab-page-third-party. When I close Dia, things seem to work.

Also, disabling all non-Claude extensions seemed to help, too. Can't tell which specific one(s) are causing issues.

zackpennington · 7 months ago

I get this issue a lot when using the Claude Code Chrome extension to test webpages.

Spidey-IO · 7 months ago

Also affected. macOS, Claude Code 2.1.3. Was working late December, started failing early January. Error shows "Cannot access a chrome-extension:// URL of different extension" when using debugger API tools (screenshot, javascript_tool). Accessibility tree tools (read_page, navigate, find) still work.

timgaunt · 7 months ago

Same issue here, I've allowed JavaScript events as suggested. Disabling all extensions appears to do the trick. Happy to help debug if needed

koke1997 · 7 months ago
  • I got the same error happening randomly and after looking into the inspecting the service worker - i found some logs there

Unchecked runtime.lastError: Cannot access a chrome:// URL
mcpPermissions-njmGsNbg.js:3 Uncaught (in promise) Error: Could not establish connection. Receiving end does not exist.

of which

(16)Unchecked runtime.lastError: Debugger is not attached to the tab with id: 270581492.

<details><summary>Details</summary>
<p>
<img width="2930" height="860" alt="Image" src="https://github.com/user-attachments/assets/c8a7fd24-6169-460f-a741-16e8036e850a" />

<img width="2918" height="648" alt="Image" src="https://github.com/user-attachments/assets/08978dda-0d11-45e8-8360-da7811c22503" />

<img width="1312" height="1300" alt="Image" src="https://github.com/user-attachments/assets/19e1c49d-f89f-4e1d-ac01-dafa1e2c3013" />

</p>
</details>

  • Root Cause: Chrome only allows one extension to attach the CDP debugger per tab. When multiple extensions compete for debugger access, Claude's attachment fails.
  • Affected Users: Those with these types of extensions installed:
  • React/Vue/Redux DevTools
  • Selenium IDE, Puppeteer tools
  • Page inspection/screenshot tools
  • Any extension using chrome.debugger API
  • Evidence:
  • Error: "Debugger is not attached"
  • Error: "Cannot access a chrome-extension:// URL of different extension"
  • Works when other extensions disabled ✅
  • Proposed Solutions:

     // Add debugger attachment retry with conflict detection
     async function attachDebuggerSafely(tabId, maxRetries = 3) {
         for (let i = 0; i < maxRetries; i++) {
             try {
                 // Check if debugger is already attached (by us or others)
                 const targets = await chrome.debugger.getTargets();
                 const target = targets.find(t => t.tabId === tabId);
                 
                 if (target && target.attached) {
                     // Another extension has debugger attached
                     if (!target.extensionId || target.extensionId !== chrome.runtime.id) {
                         throw new Error('CDP_CONFLICT: Another extension is using the debugger');
                     }
                     return; // Already attached by us
                 }
                 
                 await chrome.debugger.attach({ tabId }, "1.3");
                 await new Promise(resolve => setTimeout(resolve, 500)); // Wait for attachment
                 return;
             } catch (err) {
                 if (i === maxRetries - 1) throw err;
                 await new Promise(resolve => setTimeout(resolve, 1000 * (i + 1)));
             }
         }
     }
     
     // Gracefully handle CDP unavailability
     async function executeWithFallback(tabId, cdpAction, fallbackAction) {
         try {
             await attachDebuggerSafely(tabId);
             return await cdpAction();
         } catch (err) {
             if (err.message.includes('CDP_CONFLICT')) {
                 console.warn('CDP unavailable, using fallback method');
                 return await fallbackAction();
             }
             throw err;
         }
     }
  • User Workaround (temporary):
  • Disable DevTools extensions when using Claude
  • Or provide a settings toggle to disable CDP-dependent features
cdalton713 · 7 months ago

For anyone else coming across this who also has numerous conflicting extensions (redux devtools, react devtools, etc) - I created a separate "Claude" chrome profile (I skipped the google account link) with only the claude extension installed which did the trick.

YasserLoukniti · 6 months ago

For me it worked when i've disabled 'uBlock Origin'

gustavostz · 6 months ago
For anyone else coming across this who also has numerous conflicting extensions (redux devtools, react devtools, etc) - I created a separate "Claude" chrome profile (I skipped the google account link) with only the claude extension installed which did the trick.

I've been using this separate profile approach as well, but the problem is that Claude Code can't target a specific Chrome profile. So if you have the extension installed in multiple profiles, like a clean "Claude" profile and your personal one, you end up having to manually enable/disable the extension depending on which profile you want Claude to use

Jiusi-pys · 6 months ago
> I fixed this: > > 1. Chrome → View → Developer → Allow JavaScript from Apple Events > 2. Refresh/re-navigate any tabs that were open before enabling the setting - old tabs don't pick up the permission change This didn't work for me, unfortunately.

chrome shut down apple password extension works!

euclidesdry · 3 months ago

For me, it only works when I turn off all the extensions except the Claude Code Extension. It's sad.

Showing cached comments. Read the full discussion on GitHub ↗