Skip to content

Instantly share code, notes, and snippets.

@erickzhao
Created March 31, 2020 23:53
Show Gist options
  • Save erickzhao/3da98e3ac483a75eb8f36a22c6a07d28 to your computer and use it in GitHub Desktop.
Save erickzhao/3da98e3ac483a75eb8f36a22c6a07d28 to your computer and use it in GitHub Desktop.
Electron Fiddle Gist
<!-- Empty -->
// Create native application menus and context menus.
//
// For more info, see:
// https://electronjs.org/docs/api/menu
const { app, BrowserWindow, Menu } = require('electron')
app.on('ready', () => {
const win1 = new BrowserWindow({ height: 600, width: 600, x:0, y:0 })
const win2 = new BrowserWindow({ height: 600, width: 600 })
win1.loadURL('https://stackexchange.com')
win2.loadURL('https://stackoverflow.com')
const template = [
{
label: 'Edit',
submenu: [
{ role: 'close' },
{ role: 'quit' },
]
}
]
const menu = Menu.buildFromTemplate(template)
Menu.setApplicationMenu(menu)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment