const { app, BrowserWindow } = require('electron');

// Add custom command line arguments before app is ready
app.commandLine.appendSwitch('host-rules', 'MAP example.com 127.0.0.1');
app.commandLine.appendSwitch('remote-debugging-port', '9222');

app.whenReady().then(() => {
    // Create the main window
    createWindow();
});

function createWindow() {
    let mainWindow = new BrowserWindow({
        width: 800,
        height: 600,
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
        }
    });

    mainWindow.loadURL('https://example.com');
    mainWindow.on('closed', () => {
        mainWindow = null;
    });
}

app.on('window-all-closed', () => {
    if (process.platform !== 'darwin') {
        app.quit();
    }
});

iapplus
919 声望10 粉丝