开发者

How can I package JSON files with my chrome extension?

I have created an extension containing a pre-existing javascript file. This javascript file requires a json config file in the same directory, but putting that file in the same directory in the extension folder didn't work. Is there some special way I have to do thi开发者_如何学Cs?

This problem also proved IMPOSSIBLE to Google since all extensions needs a json manifest file.


Try adding it in the content_scripts section of the manifest.json.

  "content_scripts": [
    {
      "matches": ["https://*/*", "http://*/*"],
      "js": ["extension.js", "config.json"],
      "run_at": "document_start",
      "all_frames": true
    }
  ],
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜