mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
Fix tracking urls not going to browser when using certain browsers
This commit is contained in:
parent
3908326fb1
commit
599df50320
1 changed files with 5 additions and 3 deletions
|
@ -380,7 +380,7 @@ fun Context.isServiceRunning(serviceClass: Class<*>): Boolean {
|
|||
}
|
||||
|
||||
fun Context.openInBrowser(url: String, @ColorInt toolbarColor: Int? = null, forceBrowser: Boolean = false) {
|
||||
this.openInBrowser(url.toUri(), toolbarColor)
|
||||
this.openInBrowser(url.toUri(), toolbarColor, forceBrowser)
|
||||
}
|
||||
|
||||
fun Context.openInBrowser(uri: Uri, @ColorInt toolbarColor: Int? = null, forceBrowser: Boolean = false) {
|
||||
|
@ -394,8 +394,10 @@ fun Context.openInBrowser(uri: Uri, @ColorInt toolbarColor: Int? = null, forceBr
|
|||
.build()
|
||||
if (forceBrowser) {
|
||||
val packages = getCustomTabsPackages().maxByOrNull { it.preferredOrder }
|
||||
val processName = packages?.activityInfo?.processName ?: return
|
||||
intent.intent.`package` = processName
|
||||
val processName = packages?.activityInfo?.processName
|
||||
if (processName == null) {
|
||||
intent.intent.`package` = processName
|
||||
}
|
||||
}
|
||||
intent.launchUrl(this, uri)
|
||||
} catch (e: Exception) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue