From f8834ee764e3ff448efe2ebc76e64cbb2f2a6f41 Mon Sep 17 00:00:00 2001 From: arkon Date: Wed, 25 Oct 2023 09:18:59 -0400 Subject: [PATCH] Avoid opening blobs as webpages Fixes #10060 (cherry picked from commit 548f7f415a28529522f5aef0d53546e8bc68957e) --- .../eu/kanade/presentation/webview/WebViewScreenContent.kt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt b/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt index b496a6a05..a5b18ca3e 100644 --- a/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt +++ b/app/src/main/java/eu/kanade/presentation/webview/WebViewScreenContent.kt @@ -124,6 +124,12 @@ fun WebViewScreenContent( request: WebResourceRequest?, ): Boolean { request?.let { + // Don't attempt to open blobs as webpages + if (it.url.toString().startsWith("blob:http")) { + return false + } + + // Continue with request, but with custom headers view?.loadUrl(it.url.toString(), headers) } return super.shouldOverrideUrlLoading(view, request)