Created
March 31, 2020 23:53
-
-
Save erickzhao/3da98e3ac483a75eb8f36a22c6a07d28 to your computer and use it in GitHub Desktop.
Electron Fiddle Gist
This file contains 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
<!-- Empty --> |
This file contains 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
// 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) | |
}) |
This file contains 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
// Empty |
This file contains 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
// Empty |
This file contains 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
/* Empty */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment