Adds ability to change search provider

This commit is contained in:
James Magahern
2021-03-09 12:20:51 -08:00
parent 1e39582a46
commit fb03ca2676
5 changed files with 128 additions and 6 deletions

View File

@@ -534,12 +534,7 @@ extension BrowserViewController: UITextFieldDelegate
tab.beginLoadingURL(url)
} else {
// Assume google search
let queryString = text
.replacingOccurrences(of: " ", with: "+")
.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!
let searchURL = URL(string: "https://google.com/search?q=\(queryString)&gbv=1")! // gbv=1: no JS
let searchURL = Settings.shared.searchProvider.provider().searchURLWithQuery(text)
tab.beginLoadingURL(searchURL)
}