Created
July 4, 2018 09:37
-
-
Save Gvozd/2cec0c8c510a707854e439fb15c561b0 to your computer and use it in GitHub Desktop.
Facebook, OAuth login. Correct opener in window
Author
This worked(in your example, prevention is forgotten):
mainWindow.webContents.on('new-window', function (e, url, frameName, disposition, options) {
options.webPreferences.affinity = 'main-window';
Object.assign(options, {
width: 100,
height: 500
})
// not really need uncomment next lines. not sure, but navigation(in child window) may break, or something else
// e.newGuest = new BrowserWindow(options)
// e.preventDefault();
});I also want to note that the workaround works only in the electron@2
In my last tests, this solution not actually worked at electron@3-4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It will be great if you could add the new window implementation inside the 'new-window' event handler.
It seems like the above code is not working.