我正在尝试为自己创建一个chrome扩展,然而,我遇到了一些困难。**这是我的第一个扩展,所以我可能犯了一些愚蠢的错误。
在打包我的扩展时,chrome给了我一个错误,声明:
清单不是有效的JSON。第6行,第3列,语法错误。
以下是我的JSON的代码:
{
"name" : "Hello!",
"version" : "1.0",
"manifest_version":2,
"description":""
"background": {
"scripts": ["change.js"]
},
"permissions":[
"background",
"http://*/*",
"https://*/*"
]
}出现问题的代码行是:
"background": {我还包括了我的change.js:
// ==UserScript==
// @name New Userscript
// @version 0.1
// @description try to take over the world!
// @author You
// @match www.youtube.com
// @grant none
// @run-at document-start
// ==/UserScript==
var td = document.querySelector('tr:nth-child(1)> td:nth-child(5)');
td.innerText = 'Georgia';此外,change.js也是我用tampermonkey编写的用户脚本。脚本中是否有需要更改的内容?
谢谢
发布于 2016-12-26 07:53:53
在"description":""后面添加一个逗号,如下所示:"description":"",
使用http://jsonlint.com/之类的JSON验证器来解决这些类型的JSON错误
https://stackoverflow.com/questions/41325284
复制相似问题