Skip to content

Commit 8fcff3b

Browse files
committed
Always prefer known-good browsers for testing
1 parent 161559b commit 8fcff3b

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

app/src/main/java/tech/httptoolkit/android/MainActivity.kt

+5-7
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,11 @@ class MainActivity : AppCompatActivity(), CoroutineScope by MainScope() {
444444
this.currentProxyConfig!! // Safe!! because you can only run tests while connected
445445
) == "system"
446446

447-
val testBrowser = if (certIsSystemTrusted) {
448-
null // If we have a system cert, we can safely always use the system browser
449-
} else {
450-
// If not, and there is a supported browser available, we use it. This prioritises
451-
// the default browser, and only returns null if no known supported browser exists.
452-
getTestBrowserPackage(this)
453-
}
447+
// If we have a system cert, in theory we could use any browser. In practice though, some
448+
// (i.e. Firefox) ignore system certs to use their own settings. It's best to try and ensure
449+
// for testing, we always use a supported browser. This will prioritize the default, if it
450+
// is supported, so only matters if the default browser is not on our known-good list.
451+
val testBrowser = getTestBrowserPackage(this)
454452

455453
val canUseHttps = testBrowser != null || certIsSystemTrusted
456454

0 commit comments

Comments
 (0)