I got it working and figured I'd try breaking my solution again in as many different ways possible to answer my originally posed questions. However, I do not remember/know why it didn't work before. In fact, it only started working after I gave up; I had to restart Chrome since an update was installed (34.0.1847.116 m), after which all of a sudden my native application showed up since the plugin I was working on was still enabled.
That aside, the following is a report on what does and does not work by changing some things and seeing whether the native application is still launched.
1. On Windows, when does Chrome try to load the manifests from NativeMessagingHosts
in the registry?
Whenever you click "Reload" on the extension you are developing in "chrome://extensions/", the native host will be loaded again from the registry. In other words, it suffices to click reload to verify whether your manifest files and registry are set up correctly.
2. The absolute path in the registry, how should it be formatted?
This is an example of a valid registry value:
C:\Users\Bleh\Some\Path Even With Spaces\No\Problem\someManifestFile.json
- Without surrounding quotes.
- Using single backslashes works, as do forwards slashes, or even an infinite amount of slashes. :O E.g. "C:\Some\\\Very Weird\Path".
- ".json" extension is required.
- It needs to be absolute.
3. Is there any way to get more information on what is going wrong?
Well, you might be able to look at Chromium's source code to determine exactly what happens, but other than that I don't see any more extensive feedback you can get from the offered APIs.
4. How should the path in the manifest be formatted? Example from the documentation, which seems to be correct:
"path": "C:\\Program Files\\My Application\\chrome_native_messaging_host.exe"
- Two backslashes are needed as separators.
- The path can be relative.