How to keep Google Chrome Extension popup open?
As a user, you currently cannot force the the popup to stay open. That is a UI decision the UI team made. If you want to want to force a setup, you can have other way to show this by changing the popup icon, open a new tab when it requests, or new popup view for registration.
As a developer, inspect the popup, and it will stay open.
As others have said, this is a deliberate limitation of popup UI.
Instead, you could inject some HTML into the page which loads the content you want in your popup into an element which hovers over the existing page. You will have to implement the close functionality yourself, but it will persist.
Have a look at e.g. how keyframes.app
has done it: https://github.com/mitchas/Keyframes.app/blob/master/Keyframes.app%20(Extension)/src/inject/ui.js
In an answer to a FAQ here: https://developer.chrome.com/docs/extensions/mv3/faq/#faq-persist-popups
Popups automatically close when the user focuses on some portion of the browser outside of the popup. There is no way to keep the popup open after the user has clicked away.
You cannot stop the Chrome pop-up from closing, unless you're in developer mode. You could consider this alternative, though:
Launching a normal pop-up instead:
In your popup.html
file, load a Javascript file that runs this:
var popupWindow = window.open(
chrome.extension.getURL("normal_popup.html"),
"exampleName",
"width=400,height=400"
);
window.close(); // close the Chrome extension pop-up
This will open the file normal_popup.html
in your extension in a normal pop-up window, which won't close when it loses focus. Because the name parameter is the same, the pop-up window will get reused if the user launches popup.html
again.