意想不到的字符。上传Chrome扩展时出错

时间:2022-10-24 10:20:31

I have developed a Chrome extension which works perfectly fine when I load it as an unpacked extension in Chrome. However, when I attempt to upload the zip to the Chrome Web Store, I receive the following manifest.json error:

我开发了一个Chrome扩展,当我将它作为一个未打包的扩展加载到Chrome时,它的工作效果非常好。但是,当我尝试将zip上传到Chrome Web Store时,我收到了以下清单。json错误:

An error occurred: Failed to process your item. manifest.json:8:4: unexpected char.

发生错误:未能处理您的项目。清单。json:八4:意想不到的字符。

I have already removed all comments from the JSON file. I even tested my JSON at http://jsonlint.com and it came back valid. Does anyone have any clue as to what the issue could be?

我已经从JSON文件中删除了所有注释。我甚至在http://jsonlint.com测试了我的JSON,它返回时是有效的。有人知道这是什么问题吗?

Here is my manifest.json:

这是我manifest.json:

{
  "manifest_version": 2,
  "name": "My Extension",
  "version": "0.0.0.1",
  "description": "Description goes here",
  "content_scripts": [
      {
          "matches": ["https://example.com"],
          "css": ["css/style.css"],
          "js": [
              "lib/jquery-2.1.4.min.js",
              "scripts/main.js"
          ],
          "run_at": "document_idle"
      }
  ],
  "icons": {
      "16": "icons/16.png",
      "48": "icons/48.png",
      "128": "icons/128.png"
  }
}

1 个解决方案

#1


12  

In case someone else comes across this question with a different problem (that I just had), it's because I had stray comments left in my manifest which of course I pulled from the example one, which aren't allowed in JSON

如果有人遇到了不同的问题(我刚刚遇到了),那是因为我在清单中留下了一些错误的注释,当然这是我从示例1中提取的,JSON中是不允许的

#1


12  

In case someone else comes across this question with a different problem (that I just had), it's because I had stray comments left in my manifest which of course I pulled from the example one, which aren't allowed in JSON

如果有人遇到了不同的问题(我刚刚遇到了),那是因为我在清单中留下了一些错误的注释,当然这是我从示例1中提取的,JSON中是不允许的