Skip to content

Fix debugger example to use Fetch.enable with URL patterns to prevent…#1667

Open
Shreyans-704 wants to merge 1 commit intoGoogleChrome:mainfrom
Shreyans-704:fix-debugger-fetch-patterns
Open

Fix debugger example to use Fetch.enable with URL patterns to prevent…#1667
Shreyans-704 wants to merge 1 commit intoGoogleChrome:mainfrom
Shreyans-704:fix-debugger-fetch-patterns

Conversation

@Shreyans-704
Copy link
Copy Markdown

Closes #1236

Summary

Fix the debugger sample to prevent the runtime error:
"Unchecked runtime.lastError: Cannot access a chrome-extension:// URL of different extension."

Problem

The current implementation uses Fetch.enable without restricting URL patterns, causing it to intercept all requests — including chrome-extension:// URLs.

Chrome does not allow extensions to access resources of other extensions, which leads to the runtime error when such requests are intercepted.

Solution

Restrict Fetch.enable to only intercept valid web requests (http and https) by updating the URL patterns:

javascript
patterns: [
{ urlPattern: 'http*:///' }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Debugger Example does not work

1 participant