Question

I've been trying to get the official Native Messaging example running on my Debian linux, but when I click the connect button, the connection to the host is not made and the error "Specified native messaging host not found." is returned.

From other people who have the same problem I learnt that it's probably an error in my native app manifest, but I can't find it for hours now. It is located at ~/.config/google-chrome/NativeMessagingHosts/com.google.chrome.example.echo.json and reads:

{
  "name": "com.google.chrome.example.echo",
  "description": "Chrome Native Messaging API Example Host",
  "path": "/path/to/my/home/Desktop/native.py",
  "type": "stdio",
  "allowed_origins": [
    "chrome-extension://mcmmilohkmnlhdododggiegdjholjfan/"
  ]
}

The only thing's I've changed is the chrome extension id and the path, which I checked (when running it from my shell the app launches and behaves correctly). Its code is taken from the aforementioned example.

Any idea what might be wrong? I'm stumped.

Was it helpful?

Solution

Ok, so I dug into the Chrome sources for my version (33.0.1750.117) and figured out that the json file is never read (and confirmed my finding using inotifywatch). I think (judging from this file line 143ff and this file) that the home directory is never actually looked into when the manifest file is searched.

However I came across a command line switch which can be used to locate the manifest files: --native-messaging-hosts="com.google.chrome.example.echo=~/.config/google-chrome/NativeMessagingHosts/com.google.chrome.example.echo.json". Even though this is no permanent solution it works for me, because I don't have root on the machine I'm developing on and can't write to /etc/opt/

OTHER TIPS

I've found the same to be true on OSX with Chrome 33.0.1750.117.

You have to put it in /Library/Google/Chrome/NativeMessagingHosts/ and not in user's Library/Google/Chrome/NativeMessagingHosts/ folder.

(I'd comment but my reputation didn't allow it)

https://code.google.com/p/chromium/issues/detail?id=237873

According to this bug the user-level installation will be supported in Chrome-34

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top