Webview open new window in a new webview


I am developing an app with browser feature.

Open new window by create new BrowserWindow:

myBrowserWindow.webContents.on(‘new-window’, (event, url) => {
const win = new BrowserWindow({show: false})
win.once(‘ready-to-show’, () => win.show())
event.newGuest = win
Now, I want do same thing, but I want to replace BrowserWindow by webview tag.

rootWebView.webContents.on(‘new-window’, (event, url) => {
const newWebView = document.createElement(‘webview’)
newWebView.setAttribute(‘src’, url)
event.newGuest = newWebView
How can I implement this feature?
Help me! Thanks.


Do you solve this problem i have same issue!