-
Notifications
You must be signed in to change notification settings - Fork 5
/
main.js
50 lines (39 loc) · 1.04 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
const electron = require('electron');
const url = require('url');
const path = require('path');
const{app, BrowserWindow, Menu, globalShortcut} = electron;
let mainWindow;
app.on('ready', ()=>{
globalShortcut.register('CommandOrControl+E', () => {
app.quit();
});
mainWindow = new BrowserWindow(
{
webPreferences: {
nodeIntegration: true
}, frame:false // comment this line to get DEV TOOls
}
);
mainWindow.maximize();
mainWindow.loadURL(url.format({
pathname: path.join(__dirname, 'main.html'),
protocol: 'file:',
slashes: true
}));
const menu = Menu.buildFromTemplate(mainMenu);
Menu.setApplicationMenu(menu);
});
const mainMenu = [
{
label:'Dev Tools',
submenu:[
{
label: 'Toggle Dev Tools',
accelerator: 'Ctrl+',
click(item, focusedWindow){
focusedWindow.toggleDevTools();
}
}
]
}
];