create a hidden browser window

This commit is contained in:
Stephen Birarda 2015-12-29 16:49:00 -08:00
parent e399a3709e
commit c886cde59d

View file

@ -2,6 +2,8 @@
var electron = require('electron');
var app = electron.app; // Module to control application life.
var BrowserWindow = electron.BrowserWindow;
var Menu = require('menu');
var Tray = require('tray');
var shell = require('shell');
@ -168,9 +170,16 @@ function updateTrayMenu(serverState) {
}
}
var hiddenWindow = null;
// This method will be called when Electron has finished
// initialization and is ready to create browser windows.
app.on('ready', function() {
// create a BrowserWindow so the app launches but don't show it
hiddenWindow = new BrowserWindow({
show: false
});
// hide the dock icon
app.dock.hide()