Repository navigation
Fix window.opener being null when nativeWindowOpen is used - #9961
Conversation
|
This appears to cause the renderer process to crash after the second navigation. This is due to the webContents launched from |
|
Two additional things here.
|
|
The newly opened window appears to crash when switching domains in some cases, can't figure out why. If anyone has any ideas would be appreciated 👍 |
|
Haven't confirmed, but possibly related to if |
Yeah, I was looking into this a bit as well via #9928, I think we need to get all the preferences supported that can overridden via |
Do you have the stack trace for this crash? |
@kevinsawicki As much as I try I can't get Electron to dump a crash stack on me. The renderer window just closes by itself just after a page navigation is started. Repro is as easy as |
130cb50 to
3ac2f67
Compare
|
Just figured out how to stop the random crash on navigation in the opened window Pinging @electron/maintainers this is a pretty important fix for |
| // reuse the same site to allow cross-window scripting. We do | ||
| // not need to check urls / domains as native window open logic | ||
| // handles cross site scripting protection. | ||
| if (WebContentsPreferences::UsesNativeWindowOpen(web_contents)) { |
There was a problem hiding this comment.
It seems like this is effectively if (true) since we already checked for if (!WebContentsPreferences::UsesNativeWindowOpen(web_contents)) above. Could you remove the unnecessary check?
There was a problem hiding this comment.
Technically yeah, thought it would be good to be explicit in code though. I'll change it to still be explicit but not fetch the preferences twice 👍
| // | ||
| // NOTE: We know that nativeWindowOpen is enabled at this point | ||
| // because we check if it is NOT enabled above this point. We | ||
| // will only reach this return if sanbox is disabled but |
Fixes #9581 #8100 #9533
Not 100% sure if this is the correct fix but (a) it works and (b) it looks right to me 😆
/cc @zcbenz @kevinsawicki Can you make sure this isn't doing something silly