-
Notifications
You must be signed in to change notification settings - Fork 80
Expand file tree
/
Copy pathmain.js
More file actions
38 lines (30 loc) 路 1.08 KB
/
Copy pathmain.js
File metadata and controls
38 lines (30 loc) 路 1.08 KB
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
// Electron
const { app, Menu } = require("electron");
app.whenReady().then(() => {
// Main window
const window = require("./src/window");
mainWindow = window.createBrowserWindow(app);
// Option 1: Uses Webtag and load a custom html file with external content
mainWindow.loadFile("index.html");
//mainWindow.loadURL(`file://${__dirname}/index.html`);
// Option 2: Load directly an URL if you don't need interface customization
//mainWindow.loadURL("https://github.com");
// Option 3: Uses BrowserView to load an URL
//const view = require("./src/view");
//view.createBrowserView(mainWindow);
// Display Dev Tools
//mainWindow.openDevTools();
// Menu (for standard keyboard shortcuts)
const menu = require("./src/menu");
const template = menu.createTemplate(app.name);
const builtMenu = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(builtMenu);
// Print function (if enabled)
require("./src/print");
});
// Quit when all windows are closed.
app.on("window-all-closed", () => {
//if (process.platform !== "darwin") {
app.quit();
//}
});