Skip to content

Commit

Permalink
♿ Add menu to open dev tools
Browse files Browse the repository at this point in the history
  • Loading branch information
jysperm committed Sep 24, 2017
1 parent 361884c commit e92ff29
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
const {app, BrowserWindow} = require('electron')
const {app, shell, BrowserWindow, Menu} = require('electron')
const path = require('path')
const url = require('url')

let win

process.env.PATH = `${process.env.PATH}:/usr/local/bin`

const menu = Menu.buildFromTemplate([
{
label: app.getName(),
submenu: [{
label: 'About',
click() {
shell.openExternal('https://github.com/jysperm/elecpass')
}
},{
label: 'Open DevTools',
click() {
win.webContents.openDevTools()
}
},{
role: 'quit'
}]
}
])

function createWindow () {
Menu.setApplicationMenu(menu)

win = new BrowserWindow({width: 650, height: 450})

win.loadURL(url.format({
Expand Down

0 comments on commit e92ff29

Please sign in to comment.