-->

launch my installed application from chrome browse

2019-01-20 02:56发布

问题:

My requirement is to launch my installed application from chrome browser if it is installed on client machine, If not installed then I wanted to start download. What is best recommended solution for chrome?

So fare i tried following

used NPAPI, but due to deprecation of NPAPI by chrome I can't use.

Checked PNacl and Pepper API both API not providing access to local file system to launch an application. They just port my C/C++ code in browser and run it in browser environment with sandbox restrictions.

Is it true only option i have is to use native messaging? Or is there any other option for simple task to launch my application from our url,

Regarding “Native Messaging”

  1. Do users need to install my extension
  2. Do i need to add my extension to chrome store
  3. How to deal with Registry permissions for non admin users
  4. Can i install extension to chrome along with my app installation

Note :- Found some providers use “External Protocol Request” to launch application but there are no enough resources where can i found more about this

Thanks and Regards, Pravin

回答1:

For what its worth, see here - http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/

the README indicates that Native Messaging can now be added even by non-Admins.

But it appears Native Messaging will only work for Extensions: "Extensions can exchange messages with native applications(...)" and I dont imagine you can expect all of your users to do that.



回答2:

To open it if it's installed you just need to register your application (at the OS level, so the details will vary by OS; you don't say what OS you are targeting) as a handler for some specific scheme, then have your page open that scheme. That's the same flow that causes mailto: links to open a user's mail client, for instance.



回答3:

If you have a chrome app, you can use inline install: https://developer.chrome.com/webstore/inline_installation