Skip to content

Commit a6d8b6f

Browse files
committed
fix(example): fix open childWindow error
1 parent 17142a9 commit a6d8b6f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

electron/main/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,15 @@ ipcMain.handle('open-win', (event, arg) => {
101101
const childWindow = new BrowserWindow({
102102
webPreferences: {
103103
preload,
104+
nodeIntegration: true,
105+
contextIsolation: false,
104106
},
105107
})
106108

107109
if (app.isPackaged) {
108110
childWindow.loadFile(indexHtml, { hash: arg })
109111
} else {
110-
childWindow.loadURL(`${url}/#${arg}`)
112+
childWindow.loadURL(`${url}#${arg}`)
111113
// childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
112114
}
113115
})

0 commit comments

Comments
 (0)