mirror of
https://github.com/kiwix/kiwix-android.git
synced 2025-09-09 07:16:04 -04:00
Merge pull request #3773 from kiwix/Fix#3647
Fixed: Spurious message: "Error: Loading article (Url: https://uploadwikimedia.org/wikipedia/commons/6/65/Lock-green.svg"
This commit is contained in:
commit
f0af00b7f2
@ -2037,8 +2037,7 @@ abstract class CoreReaderFragment :
|
||||
|
||||
override fun webViewFailedLoading(url: String) {
|
||||
if (isAdded) {
|
||||
val error = String.format(getString(R.string.error_article_url_not_found), url)
|
||||
Toast.makeText(requireActivity(), error, Toast.LENGTH_SHORT).show()
|
||||
Log.d(TAG_KIWIX, String.format(getString(R.string.error_article_url_not_found), url))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,13 @@ open class CoreWebViewClient(
|
||||
return if (url.startsWith(ZimFileReader.CONTENT_PREFIX)) {
|
||||
zimReaderContainer.load(url, request.requestHeaders)
|
||||
} else {
|
||||
super.shouldInterceptRequest(view, request)
|
||||
// Return an empty WebResourceResponse for the external resource to prevent
|
||||
// it from being loaded. Passing null would trigger an attempt to load the resource.
|
||||
WebResourceResponse(
|
||||
"text/css",
|
||||
Charsets.UTF_8.name(),
|
||||
null
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user