简体   繁体   中英

Chrome extension popup not opening

I understand that popups are made up of a html file. Below is my code. For some reason the popup window won't open when I click the icon. Any ideas on what the problem may be?

{
    "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
}

Try changing page_action to browser_action So like this:

{
"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

}

I've had this problem as well. But instead of changing it to browser_action , i instead kept the page_action . see declarativeContent

The thing I've heard is, browser_action should only be used if your extension use features that make sense on most pages. Else use page action.

Source: What are the differences between page action and browser action?

So with page_action, you specify what website your extension would work on with said declarativeContent.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM