Merge pull request #77 from jaw52/fix/open_child_window
fix(example): fix open childWindow error
This commit is contained in:
		
						commit
						4e3a9e3a1b
					
				| 
						 | 
					@ -92,13 +92,15 @@ ipcMain.handle('open-win', (event, arg) => {
 | 
				
			||||||
  const childWindow = new BrowserWindow({
 | 
					  const childWindow = new BrowserWindow({
 | 
				
			||||||
    webPreferences: {
 | 
					    webPreferences: {
 | 
				
			||||||
      preload,
 | 
					      preload,
 | 
				
			||||||
 | 
					      nodeIntegration: true,
 | 
				
			||||||
 | 
					      contextIsolation: false,
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (app.isPackaged) {
 | 
					  if (app.isPackaged) {
 | 
				
			||||||
    childWindow.loadFile(indexHtml, { hash: arg })
 | 
					    childWindow.loadFile(indexHtml, { hash: arg })
 | 
				
			||||||
  } else {
 | 
					  } else {
 | 
				
			||||||
    childWindow.loadURL(`${url}/#${arg}`)
 | 
					    childWindow.loadURL(`${url}#${arg}`)
 | 
				
			||||||
    // childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
 | 
					    // childWindow.webContents.openDevTools({ mode: "undocked", activate: true })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue