title: Not allowed to load local resource - Electron
body: <p>When I run my Electron app through Visual Studio Code, the main process loads, which in turn launches the <code>index.html</code> page. In the <code>index.js</code> script I redirect the browser window to a local html file called <code>startup.html</code>, located in my scripts folder, which is just a sub folder of the app. The <code>index.html</code> page does not even launch and the app generates an error with the message:</p>
  
  <blockquote>
    <p>Not allowed to load local resource</p>
  </blockquote>
  
  <p>In the DevTools console it also shows the resource that it is attempting to load:</p>
  
  <pre><code>file:///usr/local/lib/node_modules/electron/dist/Electron.app/Contents/Resources/default_app.asar/scripts/ui/startup/startup.html
  </code></pre>
  
  <p>If I run <code>npm start</code> from my project's root folder, the app launches correctly and both the <code>index.html</code> and startup.html pages get loaded.</p>
  
  <p>Visual Studio Code launches electron with:</p>
  
  <pre><code>/usr/local/bin/electron
  </code></pre>
  
  <p>This appears to be different than launching it with just <code>npm start</code>. Not sure what the difference is.</p>
  
  <p>A side note: Before I added the code to launch <code>startup.html</code>, the app would run from Visual Studio Code. Only after adding startup.html does it not work.</p>
  
  <p>What could be causing this?</p>