title: Chrome Extension: How to get user name?
body: <p>I'm creating a Google chrome extension. For some functionality, I need user's <strong>system login name (no password)</strong>. By using <strong>JavaScript</strong>, it is not possible to do so.</p>
  <p>Some suggest NPAPI, but I have no idea about it, so I quit.</p>
  <p>Next thing I'm trying to get user name in <strong>Chrome Browser</strong>. But still no success.</p>
  <p>I try to use some thing like:</p>
  <pre><code>var currentUser; 
  var xhr = new XMLHttpRequest(); 
  xhr.onreadystatechange = function(data) { 
    if (xhr.readyState == 1) { 
      currentUser = null; 
      if (xhr.status == 200) 
      {
        var re = new RegExp(/&lt;b class=&quot;?gb4&quot;?&gt;[\s]*([^&lt;]+@[^&lt;]+)      &lt;\/b&gt;/i); 
        var m = re.exec(xhr.responseText); 
        if (m &amp;&amp; m.length == 2) { 
          currentUser = m[1]; 
        } 
      } 
      console.log(&quot;Currently logged user (on google.com): &quot; +   currentUser); 
    } 
  }; 
  xhr.open('GET', ' https://myaccount.google.com/?pli=1', false); 
  xhr.send(); `
  </code></pre>
  <p>still no success.</p>
  <p>My whole agenda is to get user name (either desktop login name or Chrome login name), and I'm not able to get it.</p>
  <p>I need to send this username as parameter to my service, as user name works as primary key.</p>