You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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: 4.0.4
Operating System: Windows 10
Last Known Working Electron version:: 1.8.8
Expected Behavior
I create a BrowserWindow with nativeWindowOpen set to true. It points to a page with a webview that is navigated to a site. I call window.open("somesite") from that page, and the new window's window.opener property is set.
window.opener is set correctly when I open windows...
What is going on here? Why does navigating the webview inside of a setTimeout work, but not when navigating it when the webcontents have finished loading. It looks like Electron needs a little more time to set everything up correctly.
I'll also note that logging win.opener from the window that opens the new window shows an opener. Logging it from the new window doesn't:
Main window:
var w = window.open("https://google.com");
w.opener // correct
Window I just launched:
window.opener // null
Additional info:
Replacing webview with BrowserView appears to resolve the issue. However, there is a peculiar inconsistency it seems between BrowserView and regular Chrome. If I navigate my BrowserView to an http google.com, and open an https google.com window, window.opener is null, but I can't reproduce that behavior from Chrome when I open an https site from an http one.
If I navigate my BrowserView to an https site and open an https window from there, window.opener is set.
Side note: As can be seen from the Last Working Electron version bullet point, this used to work for me (when I was on 1.7; tested on 1.8.8 and works there too). I believe I started seeing this issue when I cleared the cache.
The text was updated successfully, but these errors were encountered:
Preflight Checklist
Issue Details
Expected Behavior
I create a
BrowserWindow
withnativeWindowOpen
set totrue
. It points to a page with a webview that is navigated to a site. I callwindow.open("somesite")
from that page, and the new window'swindow.opener
property is set.Actual Behavior
window.opener
is nullTo Reproduce
main.js:
index.html:
renderer.js:
However, if I load the URL on a
setTimeout
:window.opener
is set correctly when I open windows...What is going on here? Why does navigating the webview inside of a
setTimeout
work, but not when navigating it when the webcontents have finished loading. It looks like Electron needs a little more time to set everything up correctly.I'll also note that logging
win.opener
from the window that opens the new window shows an opener. Logging it from the new window doesn't:Main window:
Window I just launched:
Additional info:
Replacing
webview
withBrowserView
appears to resolve the issue. However, there is a peculiar inconsistency it seems betweenBrowserView
and regular Chrome. If I navigate my BrowserView to anhttp
google.com, and open anhttps
google.com window,window.opener
is null, but I can't reproduce that behavior from Chrome when I open an https site from an http one.If I navigate my BrowserView to an https site and open an https window from there,
window.opener
is set.Side note: As can be seen from the Last Working Electron version bullet point, this used to work for me (when I was on 1.7; tested on 1.8.8 and works there too). I believe I started seeing this issue when I cleared the cache.
The text was updated successfully, but these errors were encountered: