Where is chrome.app officially registered?

Looking back at http://code.google.com/chrome/extensions/api_index.html , I could not find the documentation for chrome.app. I have no problem working chrome.app.getDetails(), but I wonder if there is any form of official documentation (or why not, if not).

+5
source share
4 answers

chrome.appsince out of date. However, its functionality was moved chrome.runtimemainly to chrome.runtime.getManifest().

+11
source

, , , - . API chrome.app -, API ( renderer/resources/extensions/app.js, JSON, extension.json). JSON , JSON .

http://new.crbug.com/? , .

+3

chrome.app.getDetails() (, chrome.app) , chrome.runtime.getManifest().

chrome.runtime.getManifest .

+2

The object returned by this api chrome.app.getDetails()is simply a form of the manifest object. You can access any of these variables:

{
  // 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": [...]
}

just by calling:

var deets = chrome.app.getDetails();
console.log(deets.name);
console.log(deets.description);
console.log(deets.version);
//etc...
0
source

All Articles