const electron = require('electron'); const path = require('path'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let mainWindow; function createWindow() { mainWindow = new BrowserWindow({width: 475, height: 525, icon: path.resolve(__dirname, 'images/icon.png')}); mainWindow.loadURL(`file://${__dirname}/index.html`); mainWindow.setMenu(null); mainWindow.on('closed', function() { mainWindow = null; }); } app.on('ready', createWindow); app.on('window-all-closed', function() { if (process.platform !== 'darwin') { app.quit(); } }); app.on('activate', function() { if (mainWindow === null) { createWindow(); } });