-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
37 lines (37 loc) · 928 Bytes
/
main.js
File metadata and controls
37 lines (37 loc) · 928 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
(() => {
"use strict";
const fs = require("fs");
const { app, BrowserWindow } = require("electron");
// retrieve path to image folder from arguments
const imageFolder = process.argv[2];
if (!fs.existsSync(imageFolder)) {
console.error(`Path "${imageFolder}" does not exist`);
process.exit(1);
}
const windowStyle = {
fullscreen: {
alwaysOnTop: true,
fullscreen: true,
frame: false,
webPreferences: {
contextIsolation: false,
nodeIntegration: true,
},
},
test: {
width: 960 + 14,
height: 540 + 7,
webPreferences: {
contextIsolation: false,
nodeIntegration: true,
},
},
};
app.on("ready", () => {
let win = new BrowserWindow(windowStyle.fullscreen);
win.loadURL(`file:///${__dirname}/index.html?imageFolder=${imageFolder}`);
win.on("closed", () => {
win = null;
});
});
})();