【问题标题】:manifest.json:34:1: an object must end with '}'manifest.json:34:1: 对象必须以 '}' 结尾
【发布时间】:2015-01-05 18:10:26
【问题描述】:

我开发了一个扩展并尝试上传它。但它给出了错误:manifest.json:34:1: an object must end with '}'.

任何帮助将不胜感激。 这是 manifest.json 的内容:

{
"manifest_version" :2,
"name": "Text to Speech",
"version" :"1.0.0",
"description" :"Indian language text to speech extension. Developed under TDIL programme by TTS    consortium",
"options_page": "options.html",
"browser_action": {
"default_icon": {                    // optional
  "19": "images/text2voice.png"           // optional
},
"default_title": "Indian language TTS",      // optional; shown in tooltip
"default_popup": "popup.html"       // optional
},
"icons": { "16": "images/t2v-48.png",
       "48": "images/t2v-48.png",
      "128": "images/t2v-128.png" },

"background": {
"page": "background.html"
},
 "content_scripts": [
{
    "matches": ["<all_urls>"], //content script will be injected in all urls
  "js": ["content_script.js"]
  }
],

"permissions": [ //permitted to access following pages
"http://*/*",
"https://*/*",
"contextMenus",
"tabs"
 ]  
}

【问题讨论】:

  • JSON 文件中不能有 cmets。使用 jsonlint.com 验证您的 JSON 文件。您将获得错误所在的确切信息。

标签: google-chrome google-chrome-extension google-chrome-devtools


【解决方案1】:

您的 cmets(例如 //options)正在破坏您的 json。请尝试将 manifest.json 验证器(http://jsonlint.com) 的全部内容放入并查看错误。

【讨论】:

  • 问题是,在开发者模式下,“manifest.json”与 cmets 完美配合,但是当您实际尝试将其上传到商店时会弹出此错误。
猜你喜欢
  • 1970-01-01
  • 2019-08-07
  • 2018-08-16
  • 1970-01-01
  • 1970-01-01
  • 2011-07-05
  • 2011-09-22
  • 2015-10-19
相关资源
最近更新 更多