mirror of
https://github.com/rjNemo/screen_recorder
synced 2026-06-06 02:36:49 +00:00
36 lines
721 B
JavaScript
36 lines
721 B
JavaScript
const { app, BrowserWindow } = require("electron");
|
|
const { join } = require("path");
|
|
|
|
if (require("electron-squirrel-startup")) {
|
|
app.quit();
|
|
}
|
|
|
|
const createWindow = () => {
|
|
const mainWindow = new BrowserWindow({
|
|
width: 800,
|
|
height: 600,
|
|
icon: __dirname + "icon/icon.png",
|
|
webPreferences: {
|
|
nodeIntegration: true,
|
|
},
|
|
});
|
|
|
|
mainWindow.loadFile(join(__dirname, "index.html"));
|
|
|
|
// Open the DevTools.
|
|
// mainWindow.webContents.openDevTools();
|
|
};
|
|
|
|
app.on("ready", createWindow);
|
|
|
|
app.on("window-all-closed", () => {
|
|
if (process.platform !== "darwin") {
|
|
app.quit();
|
|
}
|
|
});
|
|
|
|
app.on("activate", () => {
|
|
if (BrowserWindow.getAllWindows().length === 0) {
|
|
createWindow();
|
|
}
|
|
});
|