Chrome Extension - Manifest V3
I am trying to build a simple chrome extension and am getting stuck on a particular error.
Uncaught (in promise) Error: Cannot access a "chrome://" URL
I found a way to counter the error, but it does not solve the problem itself.
I understood that when I use my extension, it works on "chrome://..." which I see when I inspect the extension, but can not figure out how to change that (if that even needs changing)
My code:
manifest.json
{
"version": "0.1.0",
"manifest_version": 3,
"name": "Super cool name",
"description" : "A super cool intro",
"author": "you wouldn't know him",
"permissions": ["storage", "activeTab", "scripting", "tabs"],
"host_permissions": ["tabs", "notifications", "http://*/*", "https://*/*"],
"background": {
"service_worker": "background.mjs",
"type": "module"
},
"action": {
"default_icon": {...},
"default_popup": "popup.html"
},
"icons": {...},
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["contentScripts.mjs"]
}]
}
background.mjs
chrome.tabs.onUpdated.addListener((tabId, tab) => {
if (tab.url?.startsWith("chrome://")) return undefined;
if (tab.active && changeInfo.status === "complete") {
chrome.scripting.executeScript({
target: {tabId: tabId},
files: ['contentScripts.mjs']
Any tips? Thank you for your time!