title: Chrome Extension NativeMessaging 'connectNative' undefined
body: <p>I am trying to implement a chrome extension using runtime.connectNative and postMessage. I am following the <a href="https://developer.chrome.com/extensions/messaging" rel="nofollow noreferrer">chrome documentation</a>, downloaded the <a href="https://developer.chrome.com/extensions/samples" rel="nofollow noreferrer">native messaging example</a> which I'm trying to run without any changes, while the code for the native host application can be found <a href="https://stackoverflow.com/questions/20237603/how-to-handle-chrome-runtime-sendnativemessage-in-native-app">here</a>.</p>
  
  <p>However, I'm getting the error:
  Uncaught TypeError: Cannot read property 'connectNative' of undefined.</p>
  
  <p>The error is being triggered from the javascript extension file, in this line:<br>
  port = chrome.runtime.connectNative(hostName);</p>
  
  <p>while the extension is being loaded from the manifest like so: </p>
  
  <pre><code>"app": {
     "launch": {
        "local_path": "main.html"
     }
  }
  </code></pre>
  
  <p>Any ideas how to solve the problem please?</p>
  
  <p>Chrome version 34, tested on windows 7, 8.1</p>