user5823723
user5823723

Reputation:

I'm having trouble with my extension

So, I've been working on a small Google Chrome extension that replaces some words with other words, but when I try to load the extension, Google tells me that there is a "Manifest is not valid JSON. Line: 12, column: 2, Unexpected data after root element." error, and I cannot fix it. Thanks!

   //credit goes to /u/adamrsb48

{
  "manifest_version": 2,
  "name": "Random Plugins",
  "version": "0.1"
 "background": {
    "scripts": ["background.js"],
    "persistent": false
}
  "content_scripts": [
    {
        "matches": ["http://*/*", "https://*/*"],
        "js": ["plugins.js"]
    }
]


}

Upvotes: 0

Views: 4163

Answers (2)

Dương Minh Khoa
Dương Minh Khoa

Reputation: 186

you are missing , some where i fixed it for you

{
	"manifest_version": 2,
	"name": "Random Plugins",
	"version": "0.1",
	"background": {
		"scripts": ["background.js"],
		"persistent": false
	},
	"content_scripts": [{
		"matches": ["http://*/*", "https://*/*"],
		"js": ["plugins.js"]
	}]


}

you can use this to check valid JSON

Upvotes: 0

Jered
Jered

Reputation: 169

You're missing two commas; after "version": "0.1" and after "background": {...}

Try this:

{
  "manifest_version": 2,
  "name": "Random Plugins",
  "version": "0.1",
  "background": {
    "scripts": [
      "background.js"
    ],
    "persistent": false
  },
  "content_scripts": [
    {
      "matches": [
        "http://*/*",
        "https://*/*"
      ],
      "js": [
        "plugins.js"
      ]
    }
  ]
}

Upvotes: 2

Related Questions