This page was saved using WebZIP 7.0.3.1030 offline browser on 12/24/13 11:31:37.
Address: https://crxdoc-zh.appspot.com/apps/manifest.html
Title: 清单文件格式 - Google Chrome 应用开发文档(非官方中文版)  •  Size: 20294

清单文件格式

每一个扩展程序、可安装的网络应用以及主题背景都有一个 JSON 格式的清单文件,名为 manifest.json,提供重要信息。

字段概述

如下代码展示了支持的清单文件字段,以及讨论每一个字段的链接。只有 nameversion 字段是必需的。

{
  // 必选
  "app": {
    "background": {
      // 可选
      "scripts": ["background.js"]
    }
  },
  "manifest_version": 2,
  "name": "我的应用",
  "version": "版本字符串",

  // 推荐
  "default_locale": "en",
  "description": "纯文本描述",
  "icons": {...},

  // 可选
  "author": ...,
  "commands": {
    "global": ...
  },
  "current_locale": ...,
  "display_in_launcher": ...,
  "display_in_new_tab_page": ...,
  "externally_connectable": {
    "matches": ["*://*.example.com/*"]
  },
  "file_handlers": {...},
  "import": ...,
  "key": "公钥",
  "kiosk_enabled": true,
  "kiosk_only": true,
  "media_galleries_handlers": ...,
  "minimum_chrome_version": "版本字符串",
  "nacl_modules": [...],
  "oauth2": ...,
  "offline_enabled": true,
  "optional_permissions": ...,
  "permissions": [...],
  "platforms": ...,
  "requirements": {...},
  "sandbox": [...],
  "short_name": "短名称",
  "signature": ...,
  "sockets": ...,
  "storage": {
    "managed_schema": "schema.json"
  },
  "system_indicator": ...,
  "update_url": "http://path/to/updateInfo.xml",
  "url_handlers": {...},
  "webview": ...
}