const win = new BrowserWindow({ width: 1200, height: 800 }); win.loadFile('index.html'); // 分离窗口模式,避免和页面布局互相挤压 win.webContents.openDevTools({ mode: 'detach' });