title: Cross origin requests are only supported for protocol schemes: http
body: <p>This is a general JavaScript question but it pops up in this code which uses Splunk JavaScript SDK... the error is:</p>
  
  <p>XMLHttpRequest cannot load file:///C:/proxy/services/auth/login?output_mode=json. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.
  jquery.min.js:4</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;script type="text/javascript" src="json2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="prettify.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="bootstrap.tabs.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="bootstrap.dropdown.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="jquery.placeholder.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="splunk.js"&gt;&lt;/script&gt;
  
  &lt;script type="text/javascript" charset="utf-8"&gt;
  console.log('a');
  var http = new splunkjs.ProxyHttp("/proxy");
  var service = new splunkjs.Service(http, {
      username: "admin",
      password: "Moravac123223",
      scheme: "https",
      host: "localhost",
      port: "8089",
      version: "5.0"
  });
   console.log('b');
  // First, we log in
  service.login(function(err, success) {
      // We check for both errors in the connection as well
      // as if the login itself failed.
      if (err || !success) {
          console.log("Login failure. Please check your server hostname and authentication credentials.");
          done(err || "Login failed");
          return;
      } 
  
      // Now that we're logged in, let's get a listing of all the apps.
      service.apps().fetch(function(err, apps) {
          if (err) {
              console.log("There was an error retrieving the list of applications:", err);
              done(err);
              return;
          }
  
          var appsList = apps.list();
          console.log("Applications:");
          for(var i = 0; i &lt; appsList.length; i++) {
              var app = appsList[i];
              console.log("  App " + i + ": " + app.name);
          } 
  
          done();
      });
  });
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>