Skip to content

Instantly share code, notes, and snippets.

@caionorder
Created August 20, 2016 17:19
Show Gist options
  • Save caionorder/9b0205ae5dae5da47fbb80bd0a421dd0 to your computer and use it in GitHub Desktop.
Save caionorder/9b0205ae5dae5da47fbb80bd0a421dd0 to your computer and use it in GitHub Desktop.
const {app, BrowserWindow} = require('electron')
let win
function createWindow(){
win = new BrowserWindow({
width:800,
height:600
});
win.loadURL(`file://${__dirname}/index.html`)
win.on('closed', ()=>{
win = null;
})
win.webContents.on('devtools-opened', () => {
win.webContents.closeDevTools();
})
}
app.on('ready', createWindow)
app.on('all-window-closed', () =>{
app.quit();
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment