Merge pull request #10204 from electron/revert-9961-fix-window-opener
Revert "Fix window.opener being null when nativeWindowOpen is used"
This commit is contained in:
commit
d06eeeede8
1 changed files with 3 additions and 15 deletions
|
@ -100,14 +100,13 @@ bool AtomBrowserClient::ShouldCreateNewSiteInstance(
|
|||
|
||||
int process_id = current_instance->GetProcess()->GetID();
|
||||
if (!IsRendererSandboxed(process_id)) {
|
||||
auto web_contents =
|
||||
content::WebContents::FromRenderFrameHost(render_frame_host);
|
||||
if (!WebContentsPreferences::UsesNativeWindowOpen(web_contents)) {
|
||||
if (!RendererUsesNativeWindowOpen(process_id)) {
|
||||
// non-sandboxed renderers without native window.open should always create
|
||||
// a new SiteInstance
|
||||
return true;
|
||||
}
|
||||
|
||||
auto web_contents =
|
||||
content::WebContents::FromRenderFrameHost(render_frame_host);
|
||||
if (!ChildWebContentsTracker::IsChildWebContents(web_contents)) {
|
||||
// Root WebContents should always create new process to make sure
|
||||
// native addons are loaded correctly after reload / navigation.
|
||||
|
@ -115,17 +114,6 @@ bool AtomBrowserClient::ShouldCreateNewSiteInstance(
|
|||
// reuse process to allow synchronous cross-window scripting.)
|
||||
return true;
|
||||
}
|
||||
|
||||
// In a non-sandboxed renderer with native window open we should
|
||||
// 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.
|
||||
//
|
||||
// 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 sandbox is disabled but
|
||||
// nativeWindowOpen is enabled.
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create new a SiteInstance if navigating to a different site.
|
||||
|
|
Loading…
Reference in a new issue