0

是否可以在我的扩展上下文中获取 manifest.json 的内容?例如,在我的 background.js 中,我想在 manifest.json 文件中获取“content_scripts”的内容。就像是:

chrome.manifestJson.content_scripts

4

1 回答 1

2

From the chrome.runtime.getManifest API:

The object returned is a serialization of the full manifest file.

To access the content of content_scripts in the manifest.json file, you can therefore write:

var manifest = chrome.runtime.getManifest();
console.log(manifest.content_scripts);
于 2013-10-03T12:07:33.107 回答