I'm building an Chrome Extension Manifest Version 3.
I get this error when I try installing it.
Here are the important parts of my manifest.json
:
"permissions": ["storage", "tabs", "identity", "scripting"],
"host_permissions": ["<all_urls>"],
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["scripts/contentScript.js"],
"css": ["css/content.css"],
"run_at": "document_end"
}
]
and here is my service worker code:
chrome.runtime.onInstalled.addListener(() => {
chrome.tabs.query({}, tabs => {
for (const tab of tabs) {
if (tab.url && isSupportedURL(tab.url)) {
chrome.scripting.executeScript({
target: { tabId: tab.id },
files: ['scripts/contentScript.js'],
});
chrome.scripting.insertCSS({
target: { tabId: tab.id },
files: ['css/content.css'],
});
}
}
});
});
function isSupportedURL(url) {
return url.startsWith('http') && !url.startsWith('https://chrome.google.com/webstore');
}