fix: always use new site instance for a new navigation. (#18860)
This commit is contained in:
parent
7a9e6659f0
commit
da29ce355f
3 changed files with 32 additions and 12 deletions
|
@ -429,6 +429,7 @@ AtomBrowserClient::ShouldOverrideSiteInstanceForNavigation(
|
|||
content::RenderFrameHost* speculative_rfh,
|
||||
content::BrowserContext* browser_context,
|
||||
const GURL& url,
|
||||
bool has_navigation_started,
|
||||
bool has_response_started,
|
||||
content::SiteInstance** affinity_site_instance) const {
|
||||
if (g_suppress_renderer_process_restart) {
|
||||
|
@ -463,6 +464,13 @@ AtomBrowserClient::ShouldOverrideSiteInstanceForNavigation(
|
|||
return SiteInstanceForNavigationType::FORCE_CURRENT;
|
||||
}
|
||||
|
||||
if (!has_navigation_started) {
|
||||
// If the navigation didn't start yet, ignore any candidate site instance.
|
||||
// If such instance exists, it belongs to a previous navigation still
|
||||
// taking place. Fixes https://github.com/electron/electron/issues/17576.
|
||||
return SiteInstanceForNavigationType::FORCE_NEW;
|
||||
}
|
||||
|
||||
return SiteInstanceForNavigationType::FORCE_CANDIDATE_OR_NEW;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue