Объект, возвращаемый этим API chrome.app.getDetails()
, является просто формой объекта манифеста.Вы можете получить доступ к любой из этих переменных:
{
// Required
"name": "My Extension",
"version": "versionString",
"manifest_version": 2,
// Recommended
"description": "A plain text description",
"icons": { ... },
"default_locale": "en",
// Pick one (or none)
"browser_action": {...},
"page_action": {...},
"theme": {...},
"app": {...},
// Add any of these that you need
"background": {"persistent": false, ...},
"background": {"persistent": true, ...},
"chrome_url_overrides": {...},
"content_scripts": [...],
"content_security_policy": "policyString",
"file_browser_handlers": [...],
"homepage_url": "http://path/to/homepage",
"incognito": "spanning" or "split",
"intents": {...}
"key": "publicKey",
"minimum_chrome_version": "versionString",
"nacl_modules": [...],
"offline_enabled": true,
"omnibox": { "keyword": "aString" },
"options_page": "aFile.html",
"permissions": [...],
"plugins": [...],
"requirements": {...},
"update_url": "http://path/to/updateInfo.xml",
"web_accessible_resources": [...],
"sandbox": [...]
}
, просто вызвав:
var deets = chrome.app.getDetails();
console.log(deets.name);
console.log(deets.description);
console.log(deets.version);
//etc...