Chrome扩展清单2个问题

时间:2015-05-30 08:54:59

标签: javascript google-chrome google-chrome-extension

我有以下Chrome扩展程序清单,它没有正确格式化缩进,这告诉我我没有正确创建清单 - 但是,我只是看不到问题。

{
  "name": "ReportIt",
  "version": "0.0.1",
  "manifest_version": 2,

  "default_locale": "en",
  "description": "Immediately Remove and report Child Pornography",  
  "icons": { "16": "images/icon-128.png", "128": "images/icon-128.png" },


  "content_scripts": [{ 
    "matches": ["<all_urls>"],
    "js": ["scripts/contentscript.js"],
    "run_at": "document_end",
    "all_frames": false
    }],

    "background": {
      "scripts": ["scripts/background.js"]
      },

      "permissions": [
      "http://*/*",
      "https://*/*",
      "contextMenus"
      ],
      "content_security_policy": "script-src 'self'; object-src 'self'",
      "web_accessible_resources": [
      "bower_components/angular/*",
      "scripts/background.js"
      ]
    }

上述Chrome扩展程序清单的格式有什么问题?

1 个答案:

答案 0 :(得分:1)

这个版本对我没有任何问题:

{
  "name": "ReportIt",
  "version": "0.0.1",
  "manifest_version": 2,

  // "default_locale": "en",
  "description": "Immediately Remove and report Child Pornography",
  "icons": {
    // "16": "images/icon-128.png",
    // "128": "images/icon-128.png"
  },


  "content_scripts": [{
    "matches": ["<all_urls>"],
    "js": ["scripts/contentscript.js"],
    "run_at": "document_end",
    "all_frames": false
  }],

  "background": {
    "scripts": ["scripts/background.js"]
  },

  "permissions": [
    "http://*/*",
    "https://*/*",
    "contextMenus"
  ],
  "content_security_policy": "script-src 'self'; object-src 'self'",
  "web_accessible_resources": [
    "bower_components/angular/*",
    "scripts/background.js"
  ]
}

您可以发送确切的错误消息和Chrome版本吗?