title: Chrome Native Messaging Chrome Extension
body: <p>I am trying to incorporate native messaging with my chrome extension and my java application.</p>
  
  <h2>In my chrome extension's javascript, I have the following code. (I do have the nativeMessaging permission in my manifest.json)</h2>
  
  <pre><code>function connectToNativeApp()
  {
    console.log('connecting to native app...');
    port = chrome.runtime.connectNative('com.app.native');
    port.onMessage.addListener(onNativeMessage);
    port.onDisconnect.addListener(onDisconnected);
    console.log('connected to native app...');
  }
  </code></pre>
  
  <p>When I send a message to the native app, my java app is supposed to be send backa message to the extension, but it is not. To test if it is actually connecting to the extension, I typed the host name incorrectly in the connectNative method but no error!?</p>
  
  <p>I heard something about needing to add a registry key, as I am on windows, but I do not know how to and there is no NativeMessagingHosts folder under the chrome folder in regedit.</p>
  
  <p>My native app folder is also in the same folder as the chrome extension.
  I tried looking for many tutorials, but found none useful for my problem. Why does Windows make everything complicated? :)</p>
  
  <p>Please help. Thanks for your time and help.
  Subby</p>