How to get image from html document retrieved with XMLHttpRequest?
<p>I want to get the first image of an external webpage and then display it. I use a XMLHttpRequest to get the document from the webpage, then I search for the first image in that document then display it. But no image shows up. This is for a chrome app, not a web page/website. Here is my javascript: </p>

<pre><code>var xhr = new XMLHttpRequest();
xhr.open('GET', 'https://ab.reddit.com/', true);
xhr.responseType = 'document';
xhr.onload = function(e) {
  var ext_doc = this.response;
  var img_src = ext_doc.getElementsByTagName("img")[0];
  var img_html = document.querySelector('#TestImage2');
  img_html.src = img_src.src;
};
xhr.send();
</code></pre>