8

I am running the Native messaging sample app. (http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/).

I have added registry key

 HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.google.chrome.example.echo

When i am connecting to native host i am getting error:

Failed to connect: Access to the specified native messaging host is forbidden.
FuzzyAmi
  • 7,543
  • 6
  • 45
  • 79
Nik
  • 682
  • 1
  • 8
  • 27

1 Answers1

13

According to the docs you need to explicitely give your extension access to the NativeMessagingHost in the latter's manifest:

"allowed_origins": [
    "chrome-extension://<your_extension's_ID>/"
]
gkalpak
  • 47,844
  • 8
  • 105
  • 118
  • 1
    ExpertSystem thanks for reply. I have corrected id now it is showing another error "Error when communicating with the native messaging host" – Nik Nov 26 '13 at 12:25
  • 1
    This is a totally different problem. So, I suggest posting a new answer and describing exactly what you have done. "Error when communicating..." is a very generic error message and has a wide range of possible causes, so you'll probably need to post some code. – gkalpak Nov 26 '13 at 12:33