manifest.json肯定具有“管理”权限:
{
"manifest_version": 2,
"name": "Test app",
"description": "Communicates with apps",
"version": "0.0.0.36",
"minimum_chrome_version": "23",
"offline_enabled": true,
"icons":
{
"16": "icon_16.png",
"128": "icon_128.png"
},
"app":
{
"background":
{
"scripts":
[
"main.js"
]
}
},
"permissions":
[
"unlimitedStorage",
"fullscreen",
"fileSystem.write",
"background",
"http://*/",
"management"
],
"update_url": "http://192.168.1.12/testapp.xml"
}
为什么还会抛出这个错误?
答案 0 :(得分:4)
只有扩展程序可以使用chrome.management
API。您创建的是Chrome应用,它不会实现或识别management
权限(将permissions of apps与permissions of extensions进行比较,以查看差异)。
如果您想在应用中使用management
API,则需要发布Chrome应用和 Chrome扩展程序,并使用external message passing API与每个应用进行通信其他