Skip to content
Browse files
[ITP] User initiated cross-domain link navigations getting counted as…
… Top Frame Redirects

Reviewed by Wenson Hsieh and David Kilzer.

This patch fixes a use-after-move on `userInitiatedActivity`.
The variable `wasPotentiallyInitiatedByUser` uses the RefPtr
`userInitiatedActivity` to determine if a navigation was user
initiated. Since it has already been moved, the RefPtr will
always be null. This causes an issue where ITP may incorrectly
treat a user-initiated navigation as a main frame redirect.

* Source/WebKit/UIProcess/WebPageProxy.cpp:

Canonical link:
  • Loading branch information
charliewolfe authored and ddkilzer committed Jan 2, 2023
1 parent 0e7b8c4 commit aee01bb955fb9818f0fbb802cd5b5392773a33a4
Showing 1 changed file with 1 addition and 1 deletion.
@@ -5861,7 +5861,7 @@ void WebPageProxy::decidePolicyForNavigationAction(Ref<WebProcessProxy>&& proces

auto wasPotentiallyInitiatedByUser = navigation->isLoadedWithNavigationShared() || userInitiatedActivity;
auto wasPotentiallyInitiatedByUser = navigation->isLoadedWithNavigationShared() || navigation->wasUserInitiated();
if (!sessionID().isEphemeral())
logFrameNavigation(frame, URL { m_pageLoadState.url() }, request, redirectResponse.url(), wasPotentiallyInitiatedByUser);

0 comments on commit aee01bb

Please sign in to comment.