在Chrome扩展程序中显示popup.html [英] display popup.html in chrome extension

查看:640
本文介绍了在Chrome扩展程序中显示popup.html的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我使用chrome page_action吗?有人告诉我,在manifest.json文件中声明它之后,我需要启用它.我已经阅读了文档并看到了代码示例,但尚不清楚当图标未显示为灰色时如何显示我的popup.html文件. 谢谢.

Can anyone help me with chrome page_action? Someone told me that after I've declared it inside the manifest.json file, I need to enable it. I've read the docs and saw the code examples but it's not clear how I can show my popup.html file when the icon is not grayed out. Thank you.

推荐答案

要在扩展程序中显示弹出窗口,您需要:

In order to show a popup in your extension you need:

  • 一个popup.html(您可以使用您喜欢的名称)文件.
  • 在下一个示例中可以看到,在manifest.json中定义弹出文件:
  • A popup.html (you can use the name that you prefer) file.
  • Define popup file in your manifest.json as you can see in the next example:
"browser_action": {
  "default_icon": {
    "48": "icon.png",
    "128": ".png"
   },
   "default_popup": "popup.html"
},

此外,您需要确保对扩展程序清单的版本使用正确的格式.

Also, you need to ensure that you are using the correct format for the version of the manifest of your extension.

清单的最新版本是v2 .根据官方文档,检查清单中声明的​​版本,并检查其格式是否正确

The last version of the manifest is v2. Check what is the version declared in your manifest and check if it has the correct format according with the official documentation

这篇关于在Chrome扩展程序中显示popup.html的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆