加载解压后的Chrome扩展程序-如何知道我的index.html文件在哪里?

时间:2018-07-11 22:11:39

标签: google-chrome google-chrome-extension chrome-extension-async

我有一个Chrome扩展项目,其结构如下:

project/
  dist/
    index.html
  manifest.json

当我使用“更多工具->扩展程序->加载解压的扩展程序

时”

我选择了项目的根目录,它就可以了!但是我不知道如何加载dist/index.htmlmanifest.json文件未提及dist/index.html,因此Chrome如何知道如何加载扩展名?

几个月前,我构建了此扩展程序,但现在我不知道它是如何工作的。

manifest.json文件看起来像这样:

{
  "manifest_version": 2,
  "name": "Suman Generator",
  "description": "This extension allows the user to generate test skeletons.",
  "version": "1.223",
  "browser_action": {
    "default_icon": "icon.png"
  },
  "options_page": "options.html",
  "options_ui": {
    "page": "options.html",
    "chrome_style": true
  },
  "devtools_page": "aspects/dev-tools/dist/suman-dev-tools.html",
  "optional_permissions": [
    "<all_urls>"
  ],
  "permissions": [
    "management",
    "activeTab",
    "webNavigation",
    "storage",
    "*://*/",
    "http://*/",
    "https://*/",
    "background",
    "browser",
    "tabs",
    "identity",
    "identity.email",
    "https://www.googleapis.com/",
    "pageAction",
    "notifications",
    "clipboard",
    "clipboardWrite",
    "clipboardRead",
    "unlimitedStorage",
    "webRequest",
    "userinfo",
    "webRequestBlocking",
    {
      "socket": [
        "tcp-connect:*:*"
      ]
    }
  ],
  "web_accessible_resources": [
    "modal-iframe.html"
  ],
  "icons": {
    "16": "icons/icon16.png",
    "48": "icons/icon48.png",
    "128": "icons/icon128.png"
  },
  "omnibox": {
    "keyword": "suman:chrome"
  },
  "oauth2": {
    "client_id": "5461307462-7geu9374.apps.googleusercontent.com",
    "scopes": [
      "https://www.googleapis.com/auth/userinfo.profile",
      "https://www.googleapis.com/auth/chromewebstore.readonly"
    ]
  },
  "key": "MIIBC57LwMgUdRxfY4I40oAiKy57o3tWF/A1BrTNY0nQIDAQAB",
  "short_name": "Suman Short Name",
  "offline_enabled": true,
  "background": {
    "page": "background.html",
    "persistent": true
  },
  "content_scripts": [],
  "content_security_policy": "script-src 'self' https://plus.google.com 'unsafe-inline' 'http' 'https' 'unsafe-eval' '*'; object-src '*';"
}

0 个答案:

没有答案