New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support electron V5 #47
Conversation
Blocked by electron/electron#17989 (workaround for electron/electron#18032). Tried to hook with an event listener like this: const hookWindowOpen = (webContents) => {
webContents.on('new-window', (event, url, frameName, disposition, options, additionalFeatures) => {
event.preventDefault()
Object.assign(options, {
show: false,
width: 600,
height: 800,
webPreferences: {
nodeIntegration: true,
contextIsolation: false,
preload: path.join(__dirname, '../renderer/init.js')
}
})
console.log(options);
const win = new BrowserWindow(options);
win.once('ready-to-show', () => {
win.show()
console.log(url)
win.webContents.loadURL('https://github.com')
})
event.newGuest = win;
})
}
app.on('web-contents-created', function (event, webContents) {
hookWindowOpen(webContents)
}) the |
Test with
|
// | ||
// used by: Mixmax and other apps using Google OAuth | ||
// issue ref: https://github.com/electron/electron/issues/18032 | ||
win.opener = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the fix of electron/electron#18032 in electron 5.0.4, I think we can remove most of these workarounds, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep I on it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🆙
Diff description
window.opener
reference with native window open (window.opener opened from webview is null after cross site navigation electron/electron#18032)