Files
electron/main.js
T

25 lines
496 B
JavaScript
Raw Normal View History

2025-10-30 09:08:49 +08:00
const { app, BrowserWindow, ipcMain } = require("electron");
2025-10-30 08:37:45 +08:00
2025-10-30 08:55:54 +08:00
const path = require("node:path");
2025-10-30 08:37:45 +08:00
const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600,
2025-10-30 08:55:54 +08:00
webPreferences: {
preload: path.join(__dirname, "preload.js"),
},
2025-10-30 08:37:45 +08:00
});
win.loadFile("index.html");
};
app.whenReady().then(() => {
2025-10-30 09:08:49 +08:00
ipcMain.handle("ping", () => "pong");
2025-10-30 08:37:45 +08:00
createWindow();
});
2025-10-30 08:41:34 +08:00
app.on("window-all-closed", () => {
if (process.platform !== "darwin") app.quit();
});