From 11c28132f682ce5b9806d03d38517c7f1ae5fc15 Mon Sep 17 00:00:00 2001 From: Brandon T Date: Mon, 4 Nov 2024 14:11:13 -0500 Subject: [PATCH] Fix URL-Bar typing when the URL belongs to a bookmark --- ios/brave-ios/Sources/Shared/URIFixup.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ios/brave-ios/Sources/Shared/URIFixup.swift b/ios/brave-ios/Sources/Shared/URIFixup.swift index e73b50ffee39..529616a257b4 100644 --- a/ios/brave-ios/Sources/Shared/URIFixup.swift +++ b/ios/brave-ios/Sources/Shared/URIFixup.swift @@ -118,11 +118,16 @@ public class URIFixup { return nil } - if match.type == .urlWhatYouTyped { + if [.bookmarkTitle, .historyUrl, .openTab, .urlWhatYouTyped].contains(match.type) { return match.destinationURL } if match.type == .searchWhatYouTyped { + // Technically we should be returning `destinationURL` here. + // But if the user's default search engine is `Google`, then `destinationURL` will be `BraveSearch`! + // That's because we don't use Chromium's `SearchEngine` shared in Brave-Core, and we use our own! + // If we ever refactor to use the SearchEngine logic from Brave-Core, we can safely return `destinationURL` here, + // and get rid of ALL of the above code entirely. return nil }