manifest.json文件介绍

{
    // 必须
    "manifest_version": 2,  // 清单文件的版本,这个必须写,而且必须是2
    "name": "My Extension", //
    "version": "versionString",
  
    // 推荐
    "default_locale": "en",
    "description": "A plain text description",
    "icons": {...},
  
    // 设置其中一个(或者不设置), 两者的区别是page_action的图标并不总是可见
    "browser_action": {...},
    "page_action": {...},
  
    // 选项
    "action": ...,
    "author": ...,
    "automation": ...,
    "background": {
    // 推荐, 背景页面是一个全局的页面, 他存在于扩展的整个生命周期中. 用于管理一些任务和状态
      "persistent": false,
      "page": "",
      "scripts": ["",""] 
    },
    "background_page": ...,
    "chrome_settings_overrides": {...},
    "chrome_ui_overrides": {
      "bookmarks_ui": {
        "remove_bookmark_shortcut": true,
        "remove_button": true
      }
    },
    "chrome_url_overrides": {...},
    "commands": {...},
    "content_capabilities": ...,
    "content_scripts": [{...}],
    "content_security_policy": "policyString",
    "converted_from_user_script": ...,
    "current_locale": ...,
    "declarative_net_request": ...,
    "devtools_page": "devtools.html",
    "event_rules": [{...}],
    "externally_connectable": {
      "matches": ["*://*.example.com/*"]
    },
    "file_browser_handlers": [...],
    "file_system_provider_capabilities": {
      "configurable": true,
      "multiple_mounts": true,
      "source": "network"
    },
    "homepage_url": "http://path/to/homepage",
    "import": [{"id": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"}],
    "incognito": "spanning, split, or not_allowed",
    "input_components": ...,
    "key": "publicKey",
    "minimum_chrome_version": "versionString",
    "nacl_modules": [...],
    "oauth2": ...,
    "offline_enabled": true,
    "omnibox": {
      "keyword": "aString"
    },
    "optional_permissions": ["tabs"],
    "options_page": "options.html",
    "options_ui": {
      "chrome_style": true,
      "page": "options.html"
    },
    "permissions": ["tabs"],
    "platforms": ...,
    "requirements": {...},
    "sandbox": [...],
    "short_name": "Short Name",
    "signature": ...,
    "spellcheck": ...,
    "storage": {
      "managed_schema": "schema.json"
    },
    "system_indicator": ...,
    "tts_engine": {...},
    "update_url": "http://path/to/updateInfo.xml",
    "version_name": "aString",
    "web_accessible_resources": [...]
  }
  

常用设置

"manifest_version" : 2  //用于设置chrome扩展的版本, 默认值为2, 不可修改, 不带引号
"name": "myExt"  // 扩展的名称, 在chrome扩展列表中展示
"version": "0.0.1",  // 扩展的版本号, 最多4个用点隔开的数字, 数字的取值为0-65535
"description": "描述"  // 扩展的描述信息, 在chrome扩展列表中展示
 
"browser_action": {}  // browser action 可以拥有一个图标,一个tooltip,一个popup页和一个badge
"background": {}  //  用于引用全局的js
"content_scripts": [{},{}]  //这些脚本是隔离的沙箱中运行的, 但这些脚本和他所注入的页面共享页面中的DOM.
 
"permissions": []  // 权限
"minimum_chrome_version": "26"  // 运行扩展需要的chrome最低版本
 
 
 
 
原文地址:https://www.cnblogs.com/answercard/p/9023136.html