External browser support
1. Environment
- Device: [Pixel 6]
- OS: [Android 13]
- APP: [0.9.6]
2. Describe the feature request
_(I may not respond in a timely manner, but you will be notified when this issue is resolved or refused to be resolved.)_Hi there, is it possible to add external browser?
I'm not sure what the OP is asking since the app supports external browsers so I'm to assume they are having the same issue I am. One of browsers (Firefox Focus) does not show up in the list of External Browsers. How do I add it/get it supported?
fun Context.getBrowserAppList(): List<ResolveInfo> {
val pm: PackageManager = packageManager
val intent = Intent(Intent.ACTION_MAIN).addCategory(Intent.CATEGORY_APP_BROWSER)
val appInfoList = pm.run {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
queryIntentActivities(intent, PackageManager.ResolveInfoFlags.of(0))
} else {
queryIntentActivities(intent, 0)
}
}
return appInfoList.sortedBy { it.loadLabel(pm).toString() }
}
Here it filters apps that match the CATEGORY_APP_BROWSER (are explicitly categorized as browsers). But for some reason a lot of browsers don't declare themselves as such in their manifest.
Using Intent.ACTION_VIEW instead of relaying on category should solve the issue and show all apps able to handle opening links.
val intent = Intent(Intent.ACTION_VIEW).apply {
data = Uri.parse("http://example.com") // Example link as it's necessary to add somet link here
}
I'm not sure what OP meant (not enough details in the issue)
In case OP just didn't know where to find the settings for external browsers, it can be changed in Settings » Interaction » App when link is clicked. Just change it to "Always Ask" or "Force specific browser"
It will make links inside posts open in the browser of your choice.
If OP wanted to open the article itself in external browser... I don't know of any way to do that, but I would love to see it implemented (maybe long-pressing article icon in bottom-right, or a new icon next to share icon on top)