forked from vtabary/translatol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron.js
33 lines (29 loc) · 864 Bytes
/
electron.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
const { app, BrowserWindow } = require('electron');
require('@electron/remote/main').initialize();
function createWindow() {
// Create the browser window.
let win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
enableRemoteModule: true,
},
});
win.maximize();
// and load the index.html of the app.
if (app.isPackaged) {
win.loadFile('./dist/translatol/index.html');
} else {
win.loadURL('http://localhost:4200');
}
// Emitted when the window is closed.
win.on('closed', () => {
// Dereference the window object, usually you would store windows
// in an array if your app supports multi windows, this is the time
// when you should delete the corresponding element.
win = null;
});
}
app.on('ready', createWindow);