-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
41 lines (31 loc) · 841 Bytes
/
Copy pathmain.js
File metadata and controls
41 lines (31 loc) · 841 Bytes
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
const { app, BrowserWindow, shell, ipcMain } = require('electron');
const path = require('path');
function createWindow() {
const win = new BrowserWindow({
width: 350,
height: 600,
icon: path.join(__dirname, 'favicon.ico'),
resizable: false,
alwaysOnTop: true,
frame: false,
transparent: false,
webPreferences: {
nodeIntegration: true,
contextIsolation: false
}
});
ipcMain.on('minimize-window', () => {
win.minimize();
});
ipcMain.on('close-window', () => {
win.close();
});
win.loadFile('index.html');
win.webContents.setWindowOpenHandler(({ url }) => {
shell.openExternal(url);
return { action: 'deny' };
});
}
app.whenReady().then(() => {
createWindow();
});