title: Read local XML with JS
body: <p>At the moment, due to the <a href="https://blog.chromium.org/2008/12/security-in-depth-local-web-pages.html" rel="noreferrer">security policy Chromium</a> can not read local files via ajax without <code>--allow-file-access-from-files</code>. But I currently need to create a web application where the database is a xml-file (in the extreme case, json), located in one dir with index.html. It is understood that the user can run this application locally. Are there workarounds for reading xml- (json-) file, without wrapping it in a function and change to js extension?</p>
  
  <pre><code>loadXMLFile('./file.xml').then(xml =&gt; {
      // working with xml
  });
  
  function loadXMLFile(filename) {
      return new Promise(function(resolve, reject) {
          if('ActiveXObject' in window) {
              // If is IE
              var xmlDoc = new ActiveXObject('Microsoft.XMLDOM');
              xmlDoc.async = false;
              xmlDoc.load(filename);
  
              resolve(xmlDoc.xml);
          } else {
              /*
               * how to read xml file if is not IE?
               * ...
               * resolve(something);
               */
          }
  
      }
  }
  </code></pre>