Electron - How to know when renderer window is ready : <p>In my main process I create a renderer window:</p>

<pre><code>var mainWindow = new BrowserWindow({
    height: 600,
    width: 800,
    x: 0,
    y: 0,
    frame: false,
    resizable: true
});
mainWindow.openDevTools();
mainWindow.loadURL('file://' + __dirname + '/renderer/index.html');
</code></pre>

<p>Then I want to communicate with it in some way:</p>

<pre><code>mainWindow.webContents.send('message', 'hello world');
</code></pre>

<p>However the main window doesn't receive this message because it isn't fully done being created at the time I attempt to send it.</p>

<p>I have temporarily solved this by wrapping the latter code in a setTimeout() but that is most definitely not the right way to resolve a race condition.</p>

<p>Is there a callback for when the main window is ready? I tried the 'ready-to-show' event mentioned in the docs but it did not work.</p>
