简体   繁体   中英

Chrome-extension: Programmatic way to open popup.html from background.html?

I'd like to open my popup.html from my background.html page. I'd also like to pass data using the same method also. Is this possible? Has anyone hacked a way in to doing this?

You cannot do that. The popup should be user activated if you want it to be shown.

If you would like to use a method from the background page in the popup, you can access the background page by doing the following in your popup:

var bkg = chrome.extension.getBackgroundPage();
bkg.callFunction();

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