manifest.json问题:必须引用字典键

时间:2016-11-20 22:52:51

标签: json google-chrome dictionary google-chrome-extension manifest

{
  "name": "Supreme Bot",
  "description": "Automate the checkout process for supremenewyork.com!",
  "version": "1.0.3",
  "manifest_version": 2,
  "permissions": ["*://*/*"],
  "content_scripts": [
    {
      "matches": ["*://*.supreme.com/*"],
      "js": ["jquery.js", "supreme.js"]
    }
  ],
  "browser_action": {
    "default_icon" : "icon-16.png",
    "default_title": "Enable/Disable"
  },
  "background": {
    "scripts": ["background.js"],
    "persistent": false
  },
  "icons": {
    "16": "icon-16.png"

  },
    { //this line is showing up as an error that says manifest is not valid json
//dictionary keys must be quoted
  "name": "Supreme Bot",
  ...
  "options_page": "options.html",
  ...
    }
}

我正在使用自动填充和自动结帐机器人来购买服装。我正在尝试添加一个选项页面,以便我可以调整大小(代码是在不同的文件中)。第25行第6列表示存在语法错误,必须引用字典键。有任何想法吗?

1 个答案:

答案 0 :(得分:0)

如果您检查JSON sample here,则逗号后面的那个部分应该跟一个"键"不是一对新的花括号。尝试删除它,以便您的JSON文件如下所示:

{
  "name": "Supreme Bot",
  "description": "Automate the checkout process for supremenewyork.com!",
  "version": "1.0.3",
  "manifest_version": 2,
  "permissions": ["*://*/*"],
  "content_scripts": [
    {
      "matches": ["*://*.supreme.com/*"],
      "js": ["jquery.js", "supreme.js"]
    }
  ],
  "browser_action": {
    "default_icon" : "icon-16.png",
    "default_title": "Enable/Disable"
  },
  "background": {
    "scripts": ["background.js"],
    "persistent": false
  },
  "icons": {
    "16": "icon-16.png"

  },

  "name": "Supreme Bot",
  "options_page": "options.html", 
}