Skip to content

Commit

Permalink
Only block site async if is malicious
Browse files Browse the repository at this point in the history
  • Loading branch information
CrisBarreiro committed Jan 20, 2025
1 parent edaecc6 commit 3947519
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ class WebViewRequestInterceptor(
): WebResourceResponse? {
val url: Uri? = request.url

maliciousSiteBlockerWebViewIntegration.shouldIntercept(request, documentUri) {
handleSiteBlocked(webView)
maliciousSiteBlockerWebViewIntegration.shouldIntercept(request, documentUri) { isMalicious ->
if (isMalicious) {
handleSiteBlocked(webView)
}
}?.let {
handleSiteBlocked(webView)
return it
Expand Down Expand Up @@ -183,8 +185,10 @@ class WebViewRequestInterceptor(
if (maliciousSiteBlockerWebViewIntegration.shouldOverrideUrlLoading(
url,
isForMainFrame,
) {
handleSiteBlocked(webView)
) { isMalicious ->
if (isMalicious) {
handleSiteBlocked(webView)
}
}
) {
handleSiteBlocked(webView)
Expand Down

0 comments on commit 3947519

Please sign in to comment.