-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
46 lines (36 loc) · 1.11 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const { app, BrowserWindow, shell } = require("electron");
let mainWindow;
const createWindow = () => {
mainWindow = new BrowserWindow({
height: 768,
width: 1024,
icon: `${__dirname}/miro.png`,
logo: `${__dirname}/miro.png`,
show: false,
backgroundColor: "rgb(255, 208, 47)",
});
mainWindow.removeMenu();
mainWindow.loadURL("https://miro.com/app", {
httpReferrer: {
url: "https://miro.com/",
policy: "same-origin",
},
userAgent:
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36",
});
//loadPlaceholder();
// mainWindow.webContents.openDevTools();
mainWindow.once("ready-to-show", () => {
mainWindow.show();
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
shell.openExternal(url);
return { action: "deny" };
});
});
mainWindow.on("closed", () => {
mainWindow = null;
});
};
app.on("ready", createWindow);
app.on("activate", () => mainWindow === null && createWindow());
app.on("window-all-closed", () => process.platform !== "darwin" && app.quit());