manifest.json issue: dictionary keys must be quoted - json

{
"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",
}

Related

Invalid value for 'background.service_worker'. Could not load 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"
}
}
}

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 manifest permissions migrating from V2 to V3

Am looking to migrate a manifest V2 extension to V3, but concerned extension might be disabled due to change in manifest permissions. My original plan was to create a new beta extension with existing V2 code and perms, install it from the chrome store locally, then update to manifest V3 perms and see what happens, but chrome store no longer accepts new V2 extensions.
Either the official documentation is purposely vague on the matter of permissions, or I missed something. Other SO questions I see are very specific. Hoping someone with more experience sees this and might be able to spot right away if anything may trigger with the manifest upgrade below. Ideally it's a smooth process given were already requesting a broad match on one of the content script blocks, and the permission list is also reduced.
Current manifest V2 (non pertinent values redacted)
{
"manifest_version": 2,
"name": "...",
"short_name": "...",
"description": "...",
"version": "1.8.0",
"background": {
"page": "background.html"
},
"content_scripts": [
{
"matches": ["*://*.example.com/*",
"*://example2.co/*",
"*://*.example2.com/*",
"http://www.example3.com/*", "https://www.example3.com/*"],
"css": [],
"js": ["js/content_script1.min.js"],
"run_at":"document_end"
},
{
"matches": ["http://*/*", "https://*/*"],
"exclude_matches": [
"*://example2.co/*",
"*://*.example2.com/*",
"*://*.example3.com/*"
],
"css": [],
"js": ["js/content_script2.min.js"]
}
],
"browser_action": {
"default_icon": "images/icon.png",
"default_popup": "popup.html",
"default_title": "..."
},
"permissions": [
"activeTab",
"background",
"storage",
"tabs",
"notifications",
"http://*/",
"https://*/"
],
"content_security_policy": "script-src 'self' https://ssl.google-analytics.com https://static.example.com https://api.example.com https://plugin.example.com https://example.com https://s3.us-west-2.amazonaws.com; object-src 'self'",
"externally_connectable": {
"matches": ["*://example.com/*"]
},
"icons": { ... },
"web_accessible_resources": ["/*.png", "/*.svg"]
}
New manifest V3
{
"manifest_version": 3,
"name": "...",
"version": "2.0.0",
"description": "...",
"minimum_chrome_version": "93",
"permissions": [
"storage",
"alarms"
],
"host_permissions": [
"*://*/*"
],
"web_accessible_resources": [
{
"resources": [
"/assets/*"
],
"matches": [
"*://*/*"
]
},
{
"resources": [
"chunks/*-*.js",
"ui/content-script/index.js"
],
"matches": [
"https://*/*",
"http://*/*",
"*://*/*"
]
}
],
"action": {
"default_title": "...",
"default_popup": "ui/popup/index.html",
"default_icon": { ... }
},
"icons": { ... },
"background": {
"service_worker": "service-worker.js",
"type": "module"
},
"content_scripts": [
{
"js": [
"ui/content-script/import-index.js"
],
"matches": [
"https://*/*",
"http://*/*"
],
"run_at": "document_end"
}
],
"externally_connectable": {
"matches": [
"*://example.com/*"
]
}
}

manifest.json:34:1: an object must end with '}'

I have developed an extension and trying to upload it. but it gives error:manifest.json:34:1: an object must end with '}'.
Any help will be appreciated.
here is the content of manifest.json:
{
"manifest_version" :2,
"name": "Text to Speech",
"version" :"1.0.0",
"description" :"Indian language text to speech extension. Developed under TDIL programme by TTS consortium",
"options_page": "options.html",
"browser_action": {
"default_icon": { // optional
"19": "images/text2voice.png" // optional
},
"default_title": "Indian language TTS", // optional; shown in tooltip
"default_popup": "popup.html" // optional
},
"icons": { "16": "images/t2v-48.png",
"48": "images/t2v-48.png",
"128": "images/t2v-128.png" },
"background": {
"page": "background.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"], //content script will be injected in all urls
"js": ["content_script.js"]
}
],
"permissions": [ //permitted to access following pages
"http://*/*",
"https://*/*",
"contextMenus",
"tabs"
]
}
Your comments such as //options is breaking your json. Please try to put the entire contents of manifest.json validator(http://jsonlint.com) and see the errors.

Chrome saying that manifest.json is not in utf8

I'm sure that it is I tried with/without BOM and I still get this error :
{
"manifest_version": 2,
"default_locale": "en",
"name": "__MSG_ext_name__",
"description": "__MSG_ext_description__",
"version": "1.6.0",
"icons": {
"16": "icon_16.png",
"48": "icon_48.png",
"128": "icon_128.png"
},
"browser_action": {
"default_icon": "icon_19.png",
"default_popup": "popup.html"
},
"background": {
"page": "background.html"
},
"options_page": "options.html",
"permissions": [
"tabs"
],
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*"
],
"js": [
"scripts/content.js"
],
"run_at": "document_start",
"all_frames": true
}
]
}
I used a program to mass convert all my files in UTF-8, now it works, I think as 方 觉 said, the problem was coming from another file than the manifest.