所以,我一直在研究一个小的谷歌浏览器扩展程序,用其他单词替换一些单词,但当我尝试加载扩展程序时,谷歌告诉我有一个“清单是无效的JSON。行:12 ,column:2,root元素后的意外数据。“错误,我无法解决它。谢谢!
//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"]
}
]
}
答案 0 :(得分:1)
你错过了两个逗号;在“版本”之后:“0.1”和“背景”之后:{...}
试试这个:
{
"manifest_version": 2,
"name": "Random Plugins",
"version": "0.1",
"background": {
"scripts": [
"background.js"
],
"persistent": false
},
"content_scripts": [
{
"matches": [
"http://*/*",
"https://*/*"
],
"js": [
"plugins.js"
]
}
]
}
答案 1 :(得分:0)
你遗失了,
某些地方
我为你修好了
{
"manifest_version": 2,
"name": "Random Plugins",
"version": "0.1",
"background": {
"scripts": ["background.js"],
"persistent": false
},
"content_scripts": [{
"matches": ["http://*/*", "https://*/*"],
"js": ["plugins.js"]
}]
}
您可以使用this检查有效的JSON