[英]How to launch Chrome packaged app by clicking on a button in a html page
I have created a Chrome packaged app and when i execute the following line in command prompt, it launches that packaged app: 我已经创建了一个Chrome打包的应用,当我在命令提示符下执行以下行时,它将启动该打包的应用:
"C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" --load-and-launch-app="chrome-app-path-goes-here" “ C:\\ Program Files(x86)\\ Google \\ Chrome \\ Application \\ chrome.exe” --load-and-launch-app =“ chrome-app-path-goes-here”
How can I launch this Chrome app by clicking on a button in a html page? 如何通过单击html页面中的按钮来启动此Chrome应用程序? Any javascript or jQuery way of doing this?
任何使用JavaScript或jQuery的方式吗?
Yes, it's possible. 是的,有可能。
Requirements: 要求:
Take a look at externally_connectable
: docs , example . 看一看
externally_connectable
: docs , 示例 。
What you can do is to send a message to the app, which will wake up its Event page. 您可以做的是向应用发送一条消息,这将唤醒其“事件”页面。
From there, you can open the app's window as usual. 从那里,您可以照常打开应用程序的窗口。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.