Search code examples
javascriptc++google-chromegoogle-nativeclientexternal-application

Open external application from chrome?


I'm developing an app which opens any external application from chrome. I would do it with NPAPI, but Chrome will drop its support. And some says the only way it can be achieved with Native Messaging or Native Client, but I couldn't figure out how to do it.

I tried this in Native Client but system call doesn't work.

In javascript:

naclModule.postMessage('start notepad'); // just an example, I handle it in different way.

In C++:

virtual void HandleMessage(const pp::Var& var_message) {
    if (!var_message.is_string())
      return;
    system("start notepad.exe");
}

Solution

  • Native Client does not allow you to open an external program; it provides the same functionality that is available in JavaScript.

    Only native messaging allows you to connect to an executable on the user's machine.