Home > Net >  "Your JSON is not valid. Error: Unexpected token : in JSON at position 6" (Firefox addon)?
"Your JSON is not valid. Error: Unexpected token : in JSON at position 6" (Firefox addon)?

Time:11-30

I am trying to learn how to create an add on for Firefox. I created this manifest.json file, icons, and a popup.html but I keep getting the error of "Your JSON is not valid. Error: Unexpected token : in JSON at position 6" when I attempt to load the zip file (manifest.json, icons, html) locally/manually into my Firefox browser. What is "position 6"? Why doesn't the error tell me the line number of the error in the json file?

What is going on? This is just a simple manifest.json. I have this working in Chrome complete with a content script but I am just trying to learn how to get an addon working with Firefox, thus the simplicity of this JSON manifest file.

"name":"My First Firefox Extension",
"description":"My Firest Firefox Test Extension",
"manifest_version": 2,
"browser_action": 
 {
  "icons": 
  {
   "16":"icons/upsellblockicon16x16.png",
   "32":"icons/upsellblockicon32x32.png",
   "48":"icons/upsellblockicon32x32.png"
  },
  "default_popup":"html/popup.html"
 }

CodePudding user response:

you have to start and finisht with {}, and the first 3 properties are mandatory

{
  "name":"My First Firefox Extension",
  "description":"My Firest Firefox Test Extension",
  "manifest_version": 2,
   "browser_action": {
 }
  .....
}
  • Related