GoogleChrome / GoogleChrome/chrome-extensions-samples

Debugger Example does not work

Open
#1,236 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
17.8k
Forks
9k
Avg merge
21h
Merged PRs (30d)
28

Description

**Describe the bug**
The debugger example gives: Unchecked runtime.lastError: Cannot access a chrome-extension:// URL of different extension.

Im pretty sure ```await chrome.debugger.sendCommand({ tabId }, 'Fetch.enable', { patterns: [/*...*/]})``` Is exactly what causes this.
```tabId``` comes from ```chrome.devtools.inspectedWindow.tabId```

 
**To Reproduce**
Clone the repo.
Install the debugger example
Go to a website.
Click the extension
Make a network request.
Notice this prints "Unchecked runtime.lastError: Cannot access a chrome-extension:// URL of different extension"

**Expected behavior**
This should work

**Screenshots**

![Screenshot 2024-07-21 at 8 52 52 PM](https://github.com/user-attachments/assets/5707d64f-38d3-437d-b4f5-911ff56a90b7)

Anything additional here. 🌈
This does not happen with Microsoft Edge.

Contributor guide

Open the contributing guide

Research direction

Install and run the debugger example, then reproduce the error by opening a website, clicking the extension, and making a network request. Start at the chrome.debugger.sendCommand call using chrome.devtools.inspectedWindow.tabId; done means the request completes without the cross-extension runtime error, matching the behavior reported in Microsoft Edge.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.