var app = require('app'); var BrowserWindow = require('browser-window'); var Menu = require('menu'); var globalShortcut = require('global-shortcut') var fs = require('fs'); var Tray = require('tray'); var ipc = require('ipc'); require('crash-reporter').start(); // Start crash reporter // Creating menu var menu = new Menu(); Menu.setApplicationMenu(menu); var mainWindow = null; // Make sure the application closes app.on('window-all-closed', function () { app.quit(); }); app.on('ready', function () { mainWindow = new BrowserWindow({ width: 800, height: 600, frame: false }); console.log(__dirname); mainWindow.loadUrl('file://' + __dirname + '/index.html'); mainWindow.toggleDevTools(); mainWindow.on('closed', function() { mainWindow = undefined; }); }); ipc.on('hide', function () { mainWindow.hide(); }); ipc.on('show', function () { mainWindow.show(); });