-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js
executable file
·30 lines (27 loc) · 942 Bytes
/
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
const { app, BrowserWindow } = require('electron');
const p = require('./package.json');
function createWindow() {
const win = new BrowserWindow({
width: 1920,
height: 1080,
webPreferences: {
nodeIntegration: true
},
icon: __dirname + './icon.png',
title: "Loading..."
});
win.setMenuBarVisibility(false);
win.webContents.on('before-input-event', (event, input) => {
if (input.control && input.shift && input.key.toLowerCase() === 'arrowleft') {
win.webContents.goBack();
} else if (input.control && input.shift && input.key.toLowerCase() === 'arrowright') {
win.webContents.goForward();
}
});
win.webContents.setWindowOpenHandler(({ url }) => {
win.loadURL(url);
return { action: 'deny' };
});
win.loadURL(p.url);
}
app.whenReady().then(createWindow);