You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
818 B

7 months ago
// main.js
const { app, BrowserWindow } = require('electron');
const path = require('path');
function createWindow() {
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
contextIsolation: false, // Set to false to enable console interaction
enableRemoteModule: true, // Set to true if you need to use the remote module
nodeIntegration: true // Ensure this is set to true to load renderer.js
}
});
mainWindow.maximize();
mainWindow.loadFile('index.html');
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();
}
});