Invalid value for 'background.service_worker'. Could not load manifest - manifest

I am trying to migrate/update a manifest 2 file to manifest 3. But I am getting the following error Invalid value for 'background.service_worker'. Could not load manifest.
From the original maifest 2 file I removed "persistent": true and changed "background": {"scripts": ["background.js", "worker.js"], to be "background": {"service_worker":["background.js", "worker.js"],
My full code for v3 can be seen below:
{
"manifest_version": 3,
"name": "Chrome ext",
"description": "This is an extension ",
"version": "1.1.1",
"icons": {
"128":"icon.png"
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html",
"default_title": "Open ext"
},
"options_page": "options.html",
"background": {
"service_worker": ["background.js", "worker.js"]
},
"permissions": [
"tabCapture",
"downloads",
"storage"
],
"commands": {
"start": {
"suggested_key": {
"default": "Ctrl+Shift+S",
"mac": "Command+Shift+U"
},
"description": "Start"
},
"stop": {
"suggested_key": {
"default": "Ctrl+Shift+X",
"mac": "MacCtrl+Shift+X"
},
"description": "Stop"
}
}
}

Related

No inspect views option on my Chrome extension manifest v3

I don't have the inspect views option on my google chrome extension that I am working on.
And this is my manifest.json
{
"name": "hoko's ext",
"description": "my ext",
"version": "1.0",
"manifest_version": 3,
"action": {
"default_popup": "popup.html"
},
"permissions": [
"activeTab"
],
"background": {
"service-worker": "background.js",
"type": "module"
},
"content_scripts": [
{
"matches": ["https://*/*"],
"js": ["content.js"]
}
]
}

Chrome extension: extension logo image doesn't appear or get loaded although specified in manifest file

I click the button in https://chrome://extensions and it loads my extension. However the image/logo of the extension is the default one instead of the one I provided:
manifest.js:
{
"name": "My App",
"version": "1.0.0",
"description": "My extension doesn't do anything yet!",
"manifest_version": 2,
"background": {
"persistent": false,
"scripts": ["js/clear_history.js"]
},
"icons": {
"48": "images/logo.svg",
"96": "images/logo.svg"
},
"browser_action": {
"default_icon": "images/logo.svg"
},
"options_ui": {
"page": "options.html",
"chrome_style": true
},
"permissions": ["history", "storage"],
"web_accessible_resources": ["logo.svg"]
}
Project directory:
How do I fix it?
EDIT:

manifest.json issue: dictionary keys must be quoted

{
"name": "Supreme Bot",
"description": "Automate the checkout process for supremenewyork.com!",
"version": "1.0.3",
"manifest_version": 2,
"permissions": ["*://*/*"],
"content_scripts": [
{
"matches": ["*://*.supreme.com/*"],
"js": ["jquery.js", "supreme.js"]
}
],
"browser_action": {
"default_icon" : "icon-16.png",
"default_title": "Enable/Disable"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"icons": {
"16": "icon-16.png"
},
{ //this line is showing up as an error that says manifest is not valid json
//dictionary keys must be quoted
"name": "Supreme Bot",
...
"options_page": "options.html",
...
}
}
I am working on an autofill and auto-checkout bot for buying clothing. I am trying to add an options page so that I will be able to adjust sizes (code for that is in a different file). Line 25 column 6 says that there is a syntax error where dictionary keys must be quoted. Any ideas?
If you check the JSON sample here, that part after the comma should be followed by a "key" not a new pair of curly brackets. Try removing it so your JSON file looks like this:
{
"name": "Supreme Bot",
"description": "Automate the checkout process for supremenewyork.com!",
"version": "1.0.3",
"manifest_version": 2,
"permissions": ["*://*/*"],
"content_scripts": [
{
"matches": ["*://*.supreme.com/*"],
"js": ["jquery.js", "supreme.js"]
}
],
"browser_action": {
"default_icon" : "icon-16.png",
"default_title": "Enable/Disable"
},
"background": {
"scripts": ["background.js"],
"persistent": false
},
"icons": {
"16": "icon-16.png"
},
"name": "Supreme Bot",
"options_page": "options.html",
}

alert/confirm doesn't work in chrome app - missing config?

I made a chrome app to display my web by webview tag, but the js API alert()/confirm() doesn't work. That made me wondering. Chrome app needs to config something to support confirm?
this is my manifest.json:
{
"app": {
"background": {
"scripts": ["background.js"]
}
},
"manifest_version": 2,
"name": "Performance Monitor",
"version": "1.0",
"description": "A performance monitor to show cpu and memory status.",
"icons": {
"16": "img/ccloud.png",
"48": "img/ccloud.png",
"128": "img/ccloud.png"
},
"permissions": [
"webview"
],
"webview": {
"partitions": [
{
"name": "static",
"accessible_resources": ["header.html", "footer.html", "static.png"]
},
{
"name": "trusted*",
"accessible_resources": ["local_*.html", "*.png", "*.js"]
},
{
"name": "trusted-audio",
"accessible_resources": ["*.mp3"]
}
]
}
}

Converting Chrome app manifest from V1 to v2

I have made a chrome app in manifest version 1 with the code :
{
"name": "J-Tech",
"version": "2",
"icons": { "128": "icon.png" },
"app": {
"urls": [
"http://www.j-tech-web.co.uk"
],
"launch": {
"web_url": "http://www.j-tech-web.co.uk"
}
}
}
I can't find a tutorial to make it take me the my website, can anyone tell me how
This should work
{
"name": "J-Tech",
"description": "sample Text",
"version": "2",
"manifest_version": "2",
"icons":
{
"128": "icon.png"
},
"app":
{
"urls":
[
"http://www.j-tech-web.co.uk"
],
"launch":
{
"web_url": "http://www.j-tech-web.co.uk"
}
},
"permissions":
[
]
}