mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-23 14:45:21 +00:00
Various fixes
This commit is contained in:
@@ -16,6 +16,7 @@ import WebKit
|
||||
import LinkPresentation
|
||||
import CoreServices
|
||||
import PersistentStringHash
|
||||
import UrlHandling
|
||||
|
||||
private final class WebBrowserSettingsControllerArguments {
|
||||
let context: AccountContext
|
||||
@@ -453,21 +454,6 @@ public func webBrowserSettingsController(context: AccountContext) -> ViewControl
|
||||
return controller
|
||||
}
|
||||
|
||||
private func cleanDomain(url: String) -> (domain: String, fullUrl: String) {
|
||||
if let parsedUrl = URL(string: url) {
|
||||
let host: String?
|
||||
let scheme = parsedUrl.scheme ?? "https"
|
||||
if #available(iOS 16.0, *) {
|
||||
host = parsedUrl.host(percentEncoded: true)?.lowercased()
|
||||
} else {
|
||||
host = parsedUrl.host?.lowercased()
|
||||
}
|
||||
return (host ?? url, "\(scheme)://\(host ?? "")")
|
||||
} else {
|
||||
return (url, url)
|
||||
}
|
||||
}
|
||||
|
||||
private func fetchDomainExceptionInfo(context: AccountContext, url: String) -> Signal<WebBrowserException, NoError> {
|
||||
let (domain, domainUrl) = cleanDomain(url: url)
|
||||
if #available(iOS 13.0, *), let url = URL(string: domainUrl) {
|
||||
|
||||
Reference in New Issue
Block a user