I’ve been trying for a while now and can’t get this to work.
Basically, when the extension is enabled, I want a persistent page (That will hold a socket connection regardless of whether the Browser Action icon is clicked).
The background page functions in this way. Now, I want this background page to show in the popup page (via iframe or any alternative so that it’s not another instance of the Background page.
I get something like this when I try:
“The webpage at chrome-extension://invalid/ might be temporarily down or it may have moved permanently to a new web address.”
Any ideas on a direction I could try?
The real background page is hidden, and cannot be shown (the Dev Tools for the background page can be opened by clicking on the
background.htmllink atchrome://extensions/, in Developer mode).From the popup, you can directly access methods and properties from the background page, using
chrome.extension.getBackgroundPage(). This can be used to maintain a (session-)persistent state of your extension’s popup window.When you try to load the background page in a frame/tab, a new instance of the page is shown. This, however, is not a background page. It’s treated as a normal HTML file within your extension.