Merge pull request #77 from jaw52/fix/open_child_window

fix(example): fix open childWindow error
This commit is contained in:
草鞋没号 2022-10-21 17:18:12 +08:00 committed by GitHub
commit 4e3a9e3a1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -92,13 +92,15 @@ ipcMain.handle('open-win', (event, arg) => {
const childWindow = new BrowserWindow({
webPreferences: {
preload,
nodeIntegration: true,
contextIsolation: false,
},
})
if (app.isPackaged) {
childWindow.loadFile(indexHtml, { hash: arg })
} else {
childWindow.loadURL(`${url}/#${arg}`)
childWindow.loadURL(`${url}#${arg}`)
// childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
}
})