title: Electron needs page reload to show content
body: <p>I'm new to <a href="https://electron.atom.io" rel="nofollow noreferrer">Electron</a>, my goal is to run a <a href="https://www.djangoproject.com" rel="nofollow noreferrer">Django</a> app within. The Django app has been compiled using <a href="http://www.pyinstaller.org" rel="nofollow noreferrer">PyInstaller</a> and placed correctly within my electron project structure.</p>
  
  <p>My problem is that when I start electron (<code>electron .</code>) its blank window opens. I need to hit refresh to show to right content. I cannot get this to work such that the page is reloaded to show content during electron opening. I tried the <code>reload()</code> and <code>reloadIgnoringCache()</code> option but it doesn't help... </p>
  
  <p>Analysing my window <code>webContents</code> parameters I can see that my window initially gets <code>currentIndex: -1</code> and after manually reloading <code>currentIndex: 0</code> (not sure if that is relevant...).</p>
  
  <p>Here is the relevant part of my <code>main.js</code> file: </p>
  
  <pre><code>app.on('ready', function() {
  log.info('App is ready?!....');
  
  var openWindow = function(mainAddr){
      mainWindow = new BrowserWindow({width: 1200, height: 800, backgroundColor: '#eeeeee', show:false});
      mainWindow.loadURL(mainAddr);
      mainWindow.webContents.on('did-finish-load', function() {
          mainWindow.show();
  
      });
      mainWindow.webContents.session.clearCache(function() {
          console.log("Cache has been cleared.");
      });
      mainWindow.webContents.reloadIgnoringCache();
      mainWindow.webContents.openDevTools();
      mainWindow.on('closed', function() {
          mainWindow = null;
          subpy.kill('SIGINT');
      });
  
  
  };
  </code></pre>