Chrome Extension - Manifest is not valid JSON. Line: 1, column: 2, Dictionary keys must be quoted - json

I wanted to build my first extension so I copied some code from an online tutorial (https://www.sitepoint.com/create-chrome-extension-10-minutes-flat/) I found:
{
"manifest_version": 2,
"name": "GTmetrix Analyzer Plugin",
"description": "This extension will analyze a page using GTmetrix",
"version": "1.0",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"permissions": [
"activeTab"
]
}
When I try to upload the unpacked extension I always get this error:
Manifest is not valid JSON. Line: 1, column: 2, Dictionary keys must be quoted.
What exactly can I change to make it work?
(Please give me exact instructions, I'm a newbie!)

Related

Which installed Chrome extension gives error alert?

On load of some page I getting alert (SyntaxError: "[object Object]" is not valid JSON)
But in anonymous mode all clear, so it given by Chrome extensions.
Is there a fast way to check what it is, other then going by exclusion method?
First you have to check your extension in chrome://extension and see if it shows any error on pointed location
enter image description here
if any error button shown here! than click on it to resolve error!
and [object object] is not valid json!
you can write only one value in these brackets []:
//its a right json format
"objects":["objects"]
and all of this json writes in this two brackets! {}
Here is Example of My Extension Manifest file!
{
"name": "Notify!",
"description": "A Google Chrome extension!",
"version": "1.7",
"manifest_version": 3,
"icons": {
"128": "/assets/icons/128.png",
"48": "/assets/icons/128.png",
"16": "/assets/icons/128.png"
},
"action": {
"default_icon": "/assets/icons/128.png",
"default_popup": "popup.html",
"default_title": "It's my title"
},
"background":{
"script": ["eventPage.js"]
//"service_worker": false
},
"content_scripts":[
{
"matches": ["http://*.google.com/*"],
"js": ["content.js","jquery-3.6.1.min.js"]
}
],
"permissions": [
"tabs",
"http://*.google.com/*"
]
}

Parsing error while using web-ext tool (Firefox addon)

I'am working on an addon for firefox webbrowser. If I try to run the addon with web-ext run an error with the message Error parsing manifest.json file at C:...\manifest.json: JSONError: Unexpected token "�" (0xFFFD) in JSON at position 0 while parsing near "��{\u0000\r\u0000\n\u0000 \u0000 \u0000 \u0000 \u0000\"\u0000m\u0000... occured.
web-ext-lint also shows me that the first character in my json file is illegal. This first character is a curly brace. The linter displayed me a second error in line one of a javascript file, where also a curly brace is notated. My manifest file looks like this:
{
"manifest_version": 2,
"name": "Extension name",
"version": "1.0",
"description": "description line",
"permissions": [
"activeTab"
],
"icons": {
"48": "icons/key-solid-48.png",
"96": "icons/key-solid-96.png"
},
"background": {
"scripts": ["js/filename.js"]
},
"browser_action": {
"default_icon": "icons/key-solid-32.png",
"default_title": "AntToken",
"default_popup": "html/index.html"
}
}
Why this error happens? I'am not sure if this is a compatibility problem. I'am using WebExtension version 6.8.0.

`Manifest file is invalid` when uploading my chrome extension to the Chrome Web Store

I have been developing a chrome extension locally. I just finished it and wanted to upload it to the Chrome Web Store. When I uploaded it and it told me:
An error occurred: Invalid manifest. If your manifest includes comments, please remove them as our gallery does not support them yet.
I checked the JSON to make sure it it was valid and as far as I can tell it is fully valid. I tried naming it differently and uploading it and it still didn't work. I also tried changing the encoding and that did not work. The Manifest is below
{
"name": "Name",
"version": "0.0.0.0.1",
"manifest_version": 2,
"description": "Description",
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"icons": { "128": "icon.png"},
"permissions": [
"tabs",
"http://*/*",
"webNavigation",
"history",
"storage"
],
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["js/jquery.min.js", "js/tab.js"]
}],
"background": {
"page": "background.html"
}
}
Does any one have any clue what the problem is? It is really frustrating to get this after finally finishing the extension.
Used your manifest.json, got this error.
Could not load extension from '/Users/jjperezaguinaga/samples/ext'. Required value 'version' is missing or invalid. It must be between 1-4 dot-separated integers each between 0 and 65536.
I removed some 0's from your version and I was able to load it.
replace
"version": "0.0.0.0.1"
with
"version": "1.0"

Chrome Extension manifest error

I got following error Manifest is not valid JSON. Line: 5, column: 25, Syntax error.
My manifest.json file
{
"name":"webrun",
"manifest_version":0.5.1,
"description":"Let code run in web!",
"browser_action":{
"default_icon":"icon.png",
"default_title":"webrun",
"default_popup":"index.html"
}
}
Generally, http://jsonlint.com/ can be used to validate any JSON files. 0.5.1 is an invalid value in JSON.
manifest_version has to be an integer, it can take value 1 or 2. Check Documentation.
To specify the version of your Chrome extension, use the "version" key, and quote the value:
{
"name": "webrun",
"manifest_version": 2,
"version": "0.5.1",
"description": "Let code run in web!",
"browser_action": {
"default_icon": "icon.png",
"default_title": "webrun",
"default_popup": "index.html"
}
}

Google Chrome extension dev, json manifest issue

I'm learning to write extensions for Chrome. In their tutorial on Hello World, I copied their manifest.json file and followed instructions to the letter, but when I go into the extensions panel and try to load an unpacked extension, I get an error that says the manifest file is missing or unreadable. I'm not well-versed in json, but I cut and pasted their code, and it still isn't working. Has anyone else had this problem? How do I fix it?
You have a semi-colon after the permissions array that should not be there:
Change this from:
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"browser_action": { "default_icon": "icon.png" },
"permissions": [ "api.flickr.com/"; ]
}
To:
{
"name": "My First Extension",
"version": "1.0",
"description": "The first extension that I made.",
"browser_action": { "default_icon": "icon.png" },
"permissions": [ "api.flickr.com/" ]
}
Also, if you do not have an image with the name icon.png in the root folder of your extension then you will either need to create one of remove the reference to the image.