title: How to check if a chrome:// file exists via javascript, without actually loading the file?
body: <p>I'm using the following function in a Firefox extension to check if a file exists in another extension:</p>
  
  <pre><code>function chromeFileExists(fileLoc) // in extension package
  {
      var xmlhttp = new window.XMLHttpRequest();
      try {
          xmlhttp.open("GET", "chrome://"+fileLoc, false);
          xmlhttp.send(null);
          var xmlDoc = xmlhttp.responseXML.documentElement;
      }
      catch(ex) {
          return false;
      }
      return true;
  } 
  </code></pre>
  
  <p>But the problem is, of course, that if the file does exist, it actually loads the file before it tells me.  Some of the files I'm querying are over 1MB in size, so I'd rather not load them into memory.</p>
  
  <p>How to check for the existence and return without loading the file itself?  I've tried working with onreadystatechange, but can't seem to figure it out.</p>