0

I have stated to build a chrome extensions and I ran across a problem with changing the popup file. I want to include a button that takes the user to another popup window that replaces the default one. In manifest versions 2 or less, you could do the following:

settingButton.addEventListener('click', function(){
    chrome.browserAction.setPopup({popup: "blank.html"});
}, false);

What is the alternative for this in manifest 3?

Shilab66
  • 7
  • 3
  • `browserAction` is `action` in MV3, see the [migration guide](https://developer.chrome.com/docs/extensions/mv3/intro/mv3-migration/). – wOxxOm Dec 31 '21 at 18:41
  • I tried adding the following: settingButton.addEventListener('click', function(){ chrome.action.setPopup(blank.html); }, false); Nothing happens when you click the button. – Shilab66 Jan 01 '22 at 00:03
  • This is invalid code because `blank.html` should be quoted. Also you didn't specify it using `popup` property like you did in the original code. You can debug your code in devtools. Note that the popup is a separate window so it has its own separate devtools: right-click inside the popup and select "inspect" in the menu. Also see the [documentation](https://developer.chrome.com/docs/extensions/reference/action/#method-setPopup). – wOxxOm Jan 01 '22 at 07:42

0 Answers0