title: Downloading an image using XMLHttpRequest in a userscript
body: <p>First of all there is a <a href="https://stackoverflow.com/q/4523238/1077789">question</a> with the same title here on SO but its not what I'm looking for and it doesn't have a complete answer either.</p>
  
  <p>So here's my question. Say I have this URL which directs to an image.</p>
  
  <pre><code>https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/299595_10150290138650735_543370734_8021370_355110168_n.jpg
  </code></pre>
  
  <p>Once I put this parameter <code>?dl=1</code> to the end of the URL, it becomes downloadable.</p>
  
  <pre><code>https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/299595_10150290138650735_543370734_8021370_355110168_n.jpg?dl=1
  </code></pre>
  
  <p>I'm trying to do this task through a userscript. So I used XMLHttpRequest for that.</p>
  
  <pre><code>var url = "https://fbcdn-photos-a.akamaihd.net/hphotos-ak-ash4/299595_10150290138650735_543370734_8021370_355110168_n.jpg?dl=1";
  
  var request = new XMLHttpRequest();  
  request.open("GET", url, false);   
  request.send(null);  
  
  if (request.status === 200) 
  {  
      alert(request.statusText);
  }
  </code></pre>
  
  <p>Here is a <a href="http://jsfiddle.net/BdCnm/" rel="nofollow noreferrer">fiddle</a>.</p>
  
  <p>But it does not work.</p>