Skip to content

Commit

Permalink
Only target main frame navigations for link tracking (#2052)
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayterDev authored Oct 2, 2023
1 parent af63361 commit b0829b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1297,7 +1297,7 @@ extension TabViewController: WKNavigationDelegate {

// This check needs to happen before GPC checks. Otherwise the navigation type may be rewritten to `.other`
// which would skip link rewrites.
if navigationAction.navigationType != .backForward {
if navigationAction.navigationType != .backForward && navigationAction.isTargetingMainFrame() {
let didRewriteLink = linkProtection.requestTrackingLinkRewrite(initiatingURL: webView.url,
navigationAction: navigationAction,
onStartExtracting: { showProgressIndicator() },
Expand Down

0 comments on commit b0829b6

Please sign in to comment.