Bug 1721217 - Part 6: Don't cancel concurrent loads if they are downloads, r=nika,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D126846
This commit is contained in:
Anny Gakhokidze
2021-11-25 20:40:58 +00:00
parent a81e51b3a2
commit a80d859187
4 changed files with 21 additions and 3 deletions

View File

@@ -2084,7 +2084,13 @@ bool CanonicalBrowsingContext::StartDocumentLoad(
// that we need to cancel any existing ones.
if (StaticPrefs::browser_tabs_documentchannel_parent_controlled() &&
mozilla::SessionHistoryInParent() && mCurrentLoad) {
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD);
// Make sure we are not loading a javascript URI.
MOZ_ASSERT(!aLoad->IsLoadingJSURI());
// If we want to do a download, don't cancel the current navigation.
if (!aLoad->IsDownload()) {
mCurrentLoad->Cancel(NS_BINDING_CANCELLED_OLD_LOAD);
}
}
mCurrentLoad = aLoad;