title: Android WebView throws "cross origin requests are only supported for http" exception while trying to load resource from disk
body: <p>i have developed a single page game in html/js and am trying to host it inside an android webview. i have a folder <code>src/main/assets/www/</code> and this line of code to bootstrap my app:</p>
  
  <pre><code>mWebView.loadUrl("file:///android_asset/www/index.html");
  </code></pre>
  
  <p>the <code>index.html</code> loads a <code>app.js</code> file which is my game. when i try to make an <code>xhr</code> request from within <code>app.js</code> to get <code>assets/myimage.svg</code> (physical location <code>src/main/assets/www/assets/myimage.svg</code>) :</p>
  
  <pre><code>var xhr = new XMLHttpRequest();
          xhr.open('get', 'assets/myimage.svg', true);
          xhr.send();
  </code></pre>
  
  <p>I get this error: <code>cross origin requests are only supported for http</code>. why is this a cross-origin request? what can i do to fix this? i cannot host the svg on a http webserver and cannot inline it in <code>app.js</code> - it has to be loaded from disk.</p>