![](/img/trans.png)
[英]Chrome extension service workers stops listening to events after opening popup
[英]Chrome extension popup not opening
我了解弹出式窗口是由html文件组成的。 下面是我的代码。 由于某些原因,当我单击图标时,弹出窗口将无法打开。 关于可能是什么问题的任何想法?
{
"name": "Popup Snake",
"version": "1.0",
"description": "A simple snake game popup, that can be opened by clicking the icon in the top right (after installing)",
"page_action": {
"default_popup": "popup.html"
},
"manifest_version": 2
}
尝试将page_action更改为browser_action,如下所示:
{
"name": "Popup Snake",
"version": "1.0",
"description": "A simple snake game popup, that can be opened by clicking the icon in the top right (after installing)",
"browser_action": {
"default_popup": "popup.html"
},
"manifest_version": 2
}
我也有这个问题。 但是,我没有将其更改为browser_action ,而是保留了page_action 。 参见declarativeContent
我所听到的是,仅当您的扩展程序使用对大多数页面有意义的功能时,才应使用browser_action。 否则使用页面操作。
因此,使用page_action时,您可以使用declarativeContent指定您的扩展程序可以在哪个网站上运行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.