From 559726192ac40707c59c6ae3256125a5b4775620 Mon Sep 17 00:00:00 2001 From: brave-builds <45370463+brave-builds@users.noreply.github.com> Date: Tue, 5 Nov 2024 22:36:33 +0100 Subject: [PATCH] [iOS] - Fix URL-Bar typing when the URL belongs to a bookmark (uplift to 1.72.x) (#26363) Uplift of #26359 (squashed) to beta --- 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 }