Skip to content

Commit

Permalink
fix for non-showing ssl errors on some pages
Browse files Browse the repository at this point in the history
  • Loading branch information
truefedex committed Jan 22, 2022
1 parent 9f80a85 commit fb15940
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ class WebViewEx(context: Context, val callback: Callback, val jsInterface: Andro
return
}
handler.cancel()
if (error.url == currentOriginalUrl.toString()) {//skip ssl errors during loading non-page resources (Chrome did like this too)
val errUrl = error.url ?: return
val origUrl = currentOriginalUrl ?: return
if (Uri.parse(errUrl).host == origUrl.host) {//skip ssl errors during loading non-page resources (Chrome did like this too)
showCertificateErrorPage(error)
}
}
Expand Down Expand Up @@ -461,6 +463,7 @@ class WebViewEx(context: Context, val callback: Callback, val jsInterface: Andro
}
}
else -> {
currentOriginalUrl = Uri.parse(url)
super.loadUrl(url)
}
}
Expand Down

0 comments on commit fb15940

Please sign in to comment.