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-12-16 22:27:17 +00:00
parent 10610dc7d0
commit 85b2ed966c
4 changed files with 21 additions and 3 deletions

View File

@@ -2095,7 +2095,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;