Closed
Description
Preflight Checklist
- I have read the Contributing Guidelines for this project.
- I agree to follow the Code of Conduct that this project adheres to.
- I have searched the issue tracker for an issue that matches the one I want to file, without success.
Issue Details
- Electron Version:
5.0.0
- Operating System:
macOS 10.14.4
- Last Known Working Electron version::
4.0.4
Expected Behavior
Open a Window with domain A via window.open
et navigate to domain B in the opened window should keep the window.opener
reference.
At the business logic level, sign-in with Google Auth from a web frame doesn't work. The callback on final application domain can't post a message to the window opener.
Actual Behavior
The window.opener
is null after cross-site navigation.
To Reproduce
// main.js
const { app, BrowserWindow } = require('electron')
function createWindow() {
const mainWindow = new BrowserWindow({
webPreferences: {
nodeIntegration: true,
webviewTag: true,
contextIsolation: false,
}
});
mainWindow.loadFile('index.html')
}
app.on('ready', createWindow)
app.on('window-all-closed', app.quit);
<webview src="https://mail.google.com" allowpopups></webview>
- Call
window.open('https://google.com')
from the web view dev tools - The
window.opener
is not null - Go to Github with
window.location = 'https://github.com'
; thewindow.opener
is null
Screenshots
Additional Information
Similar issues have been reported: #17869,
#15821, #8100
Also preloads doesn't load in the same origin context for the opened window.
Seems linked to #17989:
- Web view (
myapp.com
) openauth.google.com
,window.opener
is null and preloads are loaded - Web view (
myapp.com
) openauth.myapp.com
,window.opener
is set but preloads are not loaded
More details here
History: #11471 (comment)