Skip to content

Commit 5b7580e

Browse files
Use proper documentLoader for fragmentNavigation with ongoing async navigation
1 parent 625e7d5 commit 5b7580e

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Source/WebCore/loader/PolicyChecker.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,10 @@ void PolicyChecker::checkNavigationPolicy(ResourceRequest&& request, const Resou
285285
}
286286

287287
auto documentLoader = frameLoader->loaderForWebsitePolicies();
288+
// PolicyDecisionMode::Synchronous means that it is a FragmentNavigation and in that case we should use documentLoader,
289+
// because there can be ongoing (in policy or provisional state) navigation.
290+
if (policyDecisionMode == PolicyDecisionMode::Synchronous)
291+
documentLoader = frameLoader->documentLoader();
288292
auto clientRedirectSourceForHistory = documentLoader ? documentLoader->clientRedirectSourceForHistory() : String();
289293
auto navigationID = documentLoader ? documentLoader->navigationID() : 0;
290294
bool hasOpener = !!frame->opener();

0 commit comments

Comments
 (0)