Add Onion and UC Browser open-in options

This commit is contained in:
Ilya Laktyushin 2019-10-31 07:49:25 +04:00
parent 9419982c8d
commit 2d9f41ac7b
2 changed files with 16 additions and 4 deletions

View File

@ -244,10 +244,8 @@
<string>vk</string>
<string>waze</string>
<string>googlechrome</string>
<string>googlechromes</string>
<string>firefox</string>
<string>touch-http</string>
<string>touch-https</string>
<string>yandexbrowser-open-url</string>
<string>vimeo</string>
<string>vine</string>
@ -256,15 +254,15 @@
<string>citymapper</string>
<string>lyft</string>
<string>opera-http</string>
<string>opera-https</string>
<string>firefox-focus</string>
<string>ddgQuickLink</string>
<string>moovit</string>
<string>alook</string>
<string>dgis</string>
<string>microsoft-edge-http</string>
<string>microsoft-edge-https</string>
<string>brave</string>
<string>onionhttp</string>
<string>ucbrowser</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>

View File

@ -142,6 +142,20 @@ private func allOpenInOptions(context: AccountContext, item: OpenInItem) -> [Ope
options.append(OpenInOption(identifier: "alook", application: .other(title: "Alook Browser", identifier: 1261944766, scheme: "alook", store: nil), action: {
return .openUrl(url: "alook://\(url)")
}))
options.append(OpenInOption(identifier: "onion", application: .other(title: "Onion Browser", identifier: 519296448, scheme: "onionhttp"), action: {
if let url = URL(string: url), var components = URLComponents(url: url, resolvingAgainstBaseURL: true) {
components.scheme = components.scheme == "https" ? "onionhttps" : "onionhttp"
if let url = components.string {
return .openUrl(url: url)
}
}
return .none
}))
options.append(OpenInOption(identifier: "ucbrowser", application: .other(title: "UC Browser", identifier: 1048518592, scheme: "ucbrowser"), action: {
return .openUrl(url: "ucbrowser://\(url)")
}))
case let .location(location, withDirections):
let lat = location.latitude