esafwan
esafwan

Reputation: 18009

Chrome Extension Manifest Returns Error

No matter what I do, the manifest returns the following error:

 Could not load extension from 
 '/Applications/XAMPP/xamppfiles/htdocs/lab/chrome/test'. Manifest is not valid JSON.
 Line: 28, column: 2, Trailing comma not allowed.

But I have referred and copied it from the dev site hosted by chrome. I am stuck in the very first step. Below is my manifest

{

  "manifest_version": 2,
  "name": "Same Extention",
  "version": "1",

  "default_locale": "en",
  "description": "A description",



 "content_scripts": [
    {
      "matches": ["http://www.google.com/*"],
      "css": ["mystyles.css"],
      "js": ["jquery.js", "myscript.js"]
    }
  ],

}

Chrome Documentations I referred: Here & Here

Upvotes: 0

Views: 3531

Answers (1)

CD..
CD..

Reputation: 74096

Remove the comma at the end of your content_scripts array.

Instead of:

"content_scripts": [
    {
      "matches": ["http://www.google.com/*"],
      "css": ["mystyles.css"],
      "js": ["jquery.js", "myscript.js"]
    }
  ],

Try:

"content_scripts": [
    {
      "matches": ["http://www.google.com/*"],
      "css": ["mystyles.css"],
      "js": ["jquery.js", "myscript.js"]
    }
  ]

Upvotes: 3

Related Questions