Skip to content

Commit 987cb3d

Browse files
committed
refactor: break out into components, improve settings, improve light/dark mode
1 parent 65e72cf commit 987cb3d

23 files changed

+2474
-1498
lines changed

electron/main.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { BrowserWindow, ipcMain } from "electron";
2+
3+
function createWindow() {
4+
const win = new BrowserWindow({
5+
width: 1200,
6+
height: 800,
7+
webPreferences: {
8+
nodeIntegration: true,
9+
contextIsolation: true,
10+
webSecurity: true,
11+
},
12+
});
13+
14+
// Add CSP headers
15+
win.webContents.session.webRequest.onHeadersReceived((details, callback) => {
16+
callback({
17+
responseHeaders: {
18+
...details.responseHeaders,
19+
"Content-Security-Policy": [
20+
"default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self' data:;",
21+
],
22+
},
23+
});
24+
});
25+
26+
// Load the app
27+
if (process.env.VITE_DEV_SERVER_URL) {
28+
win.loadURL(process.env.VITE_DEV_SERVER_URL);
29+
win.webContents.openDevTools();
30+
} else {
31+
win.loadFile("dist/index.html");
32+
}
33+
}
34+
35+
export { createWindow };

0 commit comments

Comments
 (0)