简体   繁体   中英

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:

"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? Any javascript or jQuery way of doing this?

Yes, it's possible.

Requirements:

  • specifically whitelisting the domain in the manifest
  • knowing the app's ID (you can pin it for development )
  • having the app already installed.

Take a look at externally_connectable : docs , example .

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.

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