Bug 1608713 - Add nsIWebNavigation load flags to force TRR mode and use them to load captive portal tabs with TRR disabled. r=valentin,Gijs,baku

Differential Revision: https://phabricator.services.mozilla.com/D60860
This commit is contained in:
Nihanth Subramanya
2020-01-24 17:18:35 +00:00
parent 17893c7f64
commit fd86f8fa69
5 changed files with 20 additions and 0 deletions

View File

@@ -713,6 +713,12 @@ nsDocShell::LoadURI(nsDocShellLoadState* aLoadState, bool aSetNavigating) {
return NS_OK; // JS may not handle returning of an error code
}
if (aLoadState->LoadFlags() & LOAD_FLAGS_FORCE_TRR) {
mDefaultLoadFlags |= nsIRequest::LOAD_TRR_ONLY_MODE;
} else if (aLoadState->LoadFlags() & LOAD_FLAGS_DISABLE_TRR) {
mDefaultLoadFlags |= nsIRequest::LOAD_TRR_DISABLED_MODE;
}
if (!StartupTimeline::HasRecord(StartupTimeline::FIRST_LOAD_URI) &&
mItemType == typeContent && !NS_IsAboutBlank(aLoadState->URI())) {
StartupTimeline::RecordOnce(StartupTimeline::FIRST_LOAD_URI);