title: Chrome Extension XMLHttpRequest returning 0 using HTTPS and non-conventional port
body: <p>I'm using this function to send a <code>XHR</code> request to a server which uses <code>HTTPS</code> and a non-conventional port: <code>https://www.example.com:10000/request.php</code></p>
  
  <pre><code>function AJAXInteraction(url, callback, str) {
    var xhr = new XMLHttpRequest();
    xhr.open("POST", url, true);
    xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
    xhr.onreadystatechange = function() {
      if (xhr.readyState == 4) {
         var resp = JSON.parse(xhr.responseText);
         approveResponse (resp);
      }
    }
    xhr.send(str);
  }
  </code></pre>
  
  <p>In my <code>manifest</code> I've set the permissions to <code>"*://*/*"</code></p>
  
  <pre><code>{
    "name": "Test Extension",
    "manifest_version": 2,
    "version": "2.0",
    "description": "Extension Admin Util.",
    "devtools_page": "background.html",
    "content_scripts": [
      { "matches": ["http://*/*"], "js": ["content_script.js"] }
    ],
    "browser_action": {
      "default_icon": "icon.png",
      "default_popup": "popup.html"
    },
    "permissions": [
      "*://*/*",
      "tabs"
    ]
  }
  </code></pre>
  
  <p>The <code>XHR</code> is returning <code>0</code> and using Developer Tools the Network tab shows it was <code>cancelled</code></p>
  
  <p>What am I doing wrong?</p>