title: Native app does not work in Chrome extension
body: <p>I am trying Chrome Native Messaging API for Chrome extension.</p>
  
  <p>Manifest.json for native app:<br></p>
  
  <pre><code>{
    "name": "app.native",
    "description": "Native Message API Test.",
    "path": "native.exe",
    "type": "stdio",
    "allowed_origins": ["chrome-extension://kembignchdjhopkkcolnamikcenaocdm/"]
  }
  </code></pre>
  
  <p>Windows Registry value:<br></p>
  
  <pre><code>HKEY_LOCAL_MACHINE\SOFTWARE\Google\Chrome\NativeMessagingHosts\app.native=D:\connectNative\manifest.json
  </code></pre>
  
  <p>I also tried <code>D:\\\\connectNative\\\\manifest.json</code></p>
  
  <p>And I add "nativeMessaging" to "permissions" in Chrome extension manifest.json.</p>
  
  <p>Native app cpp:<br></p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include &lt;fstream&gt;
  
  using namespace std;
  
  int main(int argc, char* argv[]) {
      string input = "";
      string message="{\"text\": \"This is a response message\",\"num\": \"three\"}";
      unsigned int len = message.length();
      cout &lt;&lt; char(((len&gt;&gt;0) &amp; 0xFF))
           &lt;&lt; char(((len&gt;&gt;8) &amp; 0xFF))
           &lt;&lt; char(((len&gt;&gt;16) &amp; 0xFF))
           &lt;&lt; char(((len&gt;&gt;24) &amp; 0xFF));
      cout &lt;&lt; message &lt;&lt;endl;
      getline(cin, input);
      cout &lt;&lt; "You entered: " &lt;&lt; input &lt;&lt; endl;
      ofstream myfile;
      myfile.open ("example.txt");
      myfile &lt;&lt; "Writing this to a file.\n";
      myfile &lt;&lt; input;
      myfile.close();
  
      return 0;
  }
  </code></pre>
  
  <p>After all is done, i try in my Chrome extension:</p>
  
  <pre><code>var testport = chrome.runtime.connectNative('app.native');
  testport.onMessage.addListener(function(msg) {
      console.log("Received" + msg);
  });
  testport.onDisconnect.addListener(function() {
    console.log("Disconnected");
  });
  </code></pre>
  
  <p>It cannot receive any message and always print "Disconnected".</p>
  
  <p>I try to connect to a non-existing app, it still print "Disconnected", so I know this native app is not configured right.</p>
  
  <p>Can anyone point out what is wrong or what i missed?</p>