Last active
January 4, 2016 21:53
-
-
Save acao/0a2dc775e61f4cc33040 to your computer and use it in GitHub Desktop.
Minimal electron main process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* eslint strict: 0 */ | |
| 'use strict'; | |
| const electron = require('electron'); | |
| const app = electron.app; | |
| const BrowserWindow = electron.BrowserWindow; | |
| let mainWindow = null; | |
| app.on('window-all-closed', () => { | |
| if (process.platform !== 'darwin') app.quit(); | |
| }); | |
| app.on('ready', () => { | |
| mainWindow = new BrowserWindow({ width: 1024, height: 728 }); | |
| mainWindow.loadURL(`file://${__dirname}/src/index-electron.html`); | |
| mainWindow.on('closed', () => { | |
| mainWindow = null; | |
| }); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment