Skip to content

Commit

Permalink
Fix double search bar for queries containing 'amp' (#3057)
Browse files Browse the repository at this point in the history
  • Loading branch information
SlayterDev authored Jul 9, 2024
1 parent a68d0f9 commit 0ffe4d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DuckDuckGo/TabViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1528,7 +1528,9 @@ 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 && navigationAction.isTargetingMainFrame() {
if navigationAction.navigationType != .backForward,
navigationAction.isTargetingMainFrame(),
!(navigationAction.request.url?.isDuckDuckGoSearch ?? false) {
let didRewriteLink = linkProtection.requestTrackingLinkRewrite(initiatingURL: webView.url,
navigationAction: navigationAction,
onStartExtracting: { showProgressIndicator() },
Expand Down

0 comments on commit 0ffe4d6

Please sign in to comment.