Google Chrome Extension - Programmatically Open Popup

谁都会走 提交于 2019-12-17 16:49:09

问题


When you make a Google Chrome Extension you can choose to have a "Default_Popup", is there any way to programmatically open the popup?


回答1:


There is no direct way to open the popup programmatically. However, if you're looking to open it based on a keyboard shortcut, you can use the commands API with the _execute_browser_action command (the API is currently available on the beta channel only).




回答2:


There is an API, chrome.browserAction.openPopup(function callback), that will hopefully be available soon. Please star this bug: https://code.google.com/p/chromium/issues/detail?id=436489



来源:https://stackoverflow.com/questions/12868386/google-chrome-extension-programmatically-open-popup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!