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();
}
});
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。