title: Chrome Native Native Messaging Api: How to open native applictaion(.exe) per tab
body: <p>Hi I am converting my NPAPI plugin to native Messaging app.
  I have gone through <code>http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/docs/examples/api/nativeMessaging/</code> 
  In this example native app(.exe) is launched per tab.
  But in my case it is launched only once for chrome.
  Here is the my manifest.json.</p>
  
  <pre><code>{
     "background": {
        "page": "background.html"
     },
     "content_scripts": [ {
        "all_frames": true,
        "js": [ "contentscript.js" ],
        "matches": [ "http://*/*", "https://*/*" ],
        "run_at": "document_idle"
     } ],
     "description": "Native Messaging api",
     "key": "MIIBIjANBgkqhkiG9w0BAQEFAAO",
     "manifest_version": 2,
     "name": "Test Extension",
     "permissions": [ "tabs", "http://*/*", "https://*/*", "nativeMessaging" ],
  
  }
  </code></pre>
  
  <p>here is the background.html:</p>
  
  <pre><code>&lt;html&gt;
     &lt;head&gt;
       &lt;title&gt;&lt;/title&gt;
     &lt;/head&gt;
    &lt;body&gt;
       &lt;script src="background_pg_helper.js"&gt;&lt;/script&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I can launch my native application only inside "background_pg_helper.js" by calling</p>
  
  <pre><code>var hostName = "com.google.chrome.example.echo";
  port = chrome.runtime.connectNative(hostName);
  </code></pre>
  
  <p>Which is a single instance.</p>
  
  <p>I want to launch my native application as per tab so that one .exe can manage one tab. 
  how should i do this?</p>