Chrome Extension manifest error - google-chrome

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

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.

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

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!)

Manifest is invalid chrome error

When I try to install a Chrome extension that I made, it gives the following error -
My Manifest file code-
"browser_action":{
"default_icon":"icon.png",
"default_title":"Facebook Troll Chat",
"popup":"popup.html"
},
"description":"Troll Emoticons for Facebook chat!",
"name":"Facebook Troll Chat",
"manifest_version":2,
"version":"10.1"
}
I don't know what to do now.
Use the following code
{
"browser_action": {
"default_icon": "icon.png",
"default_title": "FacebookTrollChat",
"popup": "popup.html"
},
"description": "TrollEmoticonsforFacebookchat!",
"name": "FacebookTrollChat",
"manifest_version": 2,
"version": "10.1"
}
it should fix the problem.
For any Manifest Errors use JSONLint for debugging.
check your chrome version. if it's not the lasted version. update it.
i tested you manifest, It's ok.

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.