我在主进程中通过
testDialog = new BrowserWindow({
height: 735,
useContentSize: true,
width: 906,
minWidth: 700,
minHeight: 500,
webPreferences: {
nodeIntegration: true,
webSecurity: false
},
frame: false
})
const filePath = `file://${__dirname}/test.html` ;
testDialog.loadURL(filePath)
testDialog.on('closed', () => {
testDialog = null
})
testDialog.webContents.on('did-finish-load', function () {
testDialog.webContents.send("sendInfo", info);
});
}
打开一个新的窗口,新的窗口的test.html就是一个简单的html页面,现在很奇怪的就是很久不操作electron的界面,这时打开test.html对应的窗口,需要很久才能显示test.html里面的内容 ,在次打开就正常了。这样很影响用户体验,是什么原因引起的呀,我的electron版本是4.0
已经解决,调整了页面的写法,页面和第一个页面不是走的路由,就没有关系了,打开的速度就正常了