title: Cross Domain API in Chrome Extensions
body: <p>I am developing an extension for Google Chrome, which need to call some REST Api outside. My problem is I can't invoke API with http protocol while I can with https. 
  Here is my permission configuration:</p>
  
  <pre><code>"permissions": [
          "tabs",
          "storage",
          "cookies",
          "http://*/*",
          "https://*/*"
      ]
  </code></pre>
  
  <p>And here is the jQuery code to invoke outside sites:</p>
  
  <pre><code>var host =  "https://www.google.com.vn/";
      var xhr = new XMLHttpRequest();
      xhr.open("GET", host, true);
      xhr.onreadystatechange = function() {
          if (xhr.readyState == 4) {
              if (xhr.status === 200) {
                  alert(xhr.responseText)
              } else {
                  alert("Error with status:" + xhr.status);
              }
          }
      }
      xhr.send();
  </code></pre>
  
  <p>Above code work correctly with https sites, eg: <code>https://www.google.com.vn/</code>, <code>https://www.linkedin.com/</code>, ... but not working with http site such as: <code>http://stackoverflow.com/</code></p>
  
  <p>I am Android/iOS developer and I am really new with Chrome Extensions as well as jQuery. Please help to point me my mistake. Thanks in advance. </p>