const { app, BrowserWindow } = require('electron');
let mainWindow;
function createWindow() {
mainWindow = new BrowserWindow({
width: 900,
height: 700,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
enableRemoteModule: false,
webSecurity: true
},
show: false
});
// Load the React test app
mainWindow.loadFile('react-test-app.html');
// Show window when ready
mainWindow.once('ready-to-show', () => {
mainWindow.show();
});
// Open DevTools for debugging
mainWindow.webContents.openDevTools();
mainWindow.on('closed', () => {
mainWindow = null;
});
}
// Enable remote debugging for MCP server
app.commandLine.appendSwitch('remote-debugging-port', '9222');
app.whenReady().then(() => {
createWindow();
});
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
// Handle errors silently
process.on('uncaughtException', () => {
// Handle error silently
});
process.on('unhandledRejection', () => {
// Handle error silently
});