chrome-extension:即使设置了default_popup,也不会出现弹出窗口

时间:2014-07-25 09:12:51

标签: google-chrome-extension

当我点击我的扩展程序的浏览器操作按钮时,我已经尝试了所有内容但仍然没有显示弹出窗口。单击该图标并不会显示位于src / cbrowser_action / popup.html目录下的popup.html,控制台无法提供任何有用的原因导致其失败。我阅读了很多其他的答案,但这一切似乎都表明我无法看到任何遗漏。

这是我的清单

{
  "name": "Tool",
  "version": "0.0.1",
  "manifest_version": 2,
  "description": "",
  "homepage_url": "",
  "icons": {
    "16": "icons/on.png",
    "48": "icons/on.png",
    "128": "icons/on.png"
  },
  "default_locale": "en",
  "background": {
    "page": "src/bg/background.html",
    "persistent": true
  },
  "browser_action": {
    "default_icon": "icons/on.png",
    "default_title": "browser action demo",
    "default_popup" :"popup.html"
  },
  "permissions": [
    "<all_urls>", "management", "tabs", "webRequest","webNavigation", "webRequestBlocking", "storage"
  ],
  "content_scripts": [
  {
      "run_at": "document_end",
      "matches": [
        "<all_urls>"
      ],
      "js": [
       "src/lib/jquery.min.js","src/inject/content.js"
      ],
      "css": [
        "src/inject/content.css"
      ]
    }
  ]
}

popup.html

<!DOCTYPE html>
<html>
<head>
  <script type="text/javascript" src="popup.js"></script>

    <title></title>
</head>
<body>
asdfsup
</body>
</html>

popup.js

console.log('loaded');

1 个答案:

答案 0 :(得分:0)

console.log的输出不会出现在页面控制台上。弹出窗口的控制台范围是弹出窗口,右键单击浏览器操作图标并选择&#34; Inspect popup&#34;。

日志输出应该在那里可见。