![](/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.