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

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.

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/*"
]
}

JSON: Trailing comma error still present after removing the trailing comma?

Here is my JSON file:
{
"name": "Testing",
"version": "1.0",
"description": "1, 2, 3",
"permissions": ["storage"],
"background": {
"scripts": ["script.js"],
"persistent": false
},
"page_action": {
"default_popup": "index.html",
},
"manifest_version": 2
}
I am trying to create chrome extensions, and I've run into an error. When I try to upload the project it gives me an error on line 12 (the last comma) in the manifest.json, saying that there's no trailing commas allowed, yet when I go to remove it, the error is still present. Any idea why?
Thanks!
Please try to remove the comma on line 11 behinde "index.html".
That's the only possible problem I see on this.

I'm having an issue with my google chrome extension, new to code so be basic please

I'm trying to make a google chrome extension, but I'm having a problem. Please answer as basic as possible as I'm really bad at code. Whenever I upload something as a zip file, it says
"An error occurred: Failed to process your item. manifest.json:5:26:
unexpected char."
This is my code :
{
"name": "ROBLOX Character Asset ID",
"version": "1.9.0", // version
"manifest_version": 2,
"description": "This extension is for GFX artists who need their customer's character asset ID",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"alarms",
"background",
"debugger",
"notifications",
"cookies",
"https://www.roblox.com/"
],
"background": {
"scripts": ["bgWork.js", "jQuery-ver3.js"]
},
"icons": { "16": "icon.png",
"48": "icon.png",
"128": "icon.png" }
}
This has to do with the content in your scripts and when you load the extension it not being able to be processed as I loaded your manifest.json just fine (though with blank js files). So don't look towards your manifest.json, you must have an illegal character in your js file.

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.