在Chrome扩展程序中显示popup.html

编程入门 行业动态 更新时间:2024-10-26 20:25:47
本文介绍了在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

本文发布于:2023-08-06 13:12:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1312622.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:程序   Chrome   html   popup

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!