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

https://bugs.webkit.org/show_bug.cgi?id=223405
rdar://75552559

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:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Canonical link: https://commits.webkit.org/258382@main
  • 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
#endif

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

0 comments on commit aee01bb

Please sign in to comment.