Always try to use default browser when opening custom tabs on all Android versions

(cherry picked from commit 6bba52a2b6187f69520b3140635a48ca56be6e72)
This commit is contained in:
arkon 2022-01-29 10:12:39 -05:00 committed by Jobobby04
parent e33a270e4d
commit 454edf3ea2

View File

@ -292,11 +292,8 @@ fun Context.openInBrowser(uri: Uri, @ColorInt toolbarColor: Int? = null) {
.build()
)
.build()
// Force allowing browser selection for Android 12+ so that verified extensions don't
// re-open Tachiyomi
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
// Force default browser so that verified extensions don't re-open Tachiyomi
intent.intent.setPackage(defaultBrowserPackageName())
}
intent.launchUrl(this, uri)
} catch (e: Exception) {
toast(e.message)