diff --git a/app/src/main/java/io/legado/app/ui/browser/WebViewActivity.kt b/app/src/main/java/io/legado/app/ui/browser/WebViewActivity.kt index 71485b027..2f3fbef85 100644 --- a/app/src/main/java/io/legado/app/ui/browser/WebViewActivity.kt +++ b/app/src/main/java/io/legado/app/ui/browser/WebViewActivity.kt @@ -66,6 +66,12 @@ class WebViewActivity : VMBaseActivity() { when (item.itemId) { R.id.menu_open_in_browser -> openUrl(viewModel.baseUrl) R.id.menu_copy_url -> sendToClip(viewModel.baseUrl) + R.id.menu_ok -> { + if (viewModel.sourceVerificationEnable) { + binding.titleBar.snackbar(R.string.ok) + activity?.finish() + } + } } return super.onCompatOptionsItemSelected(item) } diff --git a/app/src/main/java/io/legado/app/ui/browser/WebViewModel.kt b/app/src/main/java/io/legado/app/ui/browser/WebViewModel.kt index 79f6e21ad..7471db654 100644 --- a/app/src/main/java/io/legado/app/ui/browser/WebViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/browser/WebViewModel.kt @@ -87,7 +87,7 @@ class WebViewModel(application: Application) : BaseViewModel(application) { if (sourceVerificationEnable) { val key = "${sourceOrigin}_verificationResult" html = AnalyzeUrl(baseUrl, headerMapF = headerMap).getStrResponse(useWebView = false).body - CacheManager.put(key, html!!) + CacheManager.put(key, html ?: "") } } diff --git a/app/src/main/res/menu/web_view.xml b/app/src/main/res/menu/web_view.xml index 281e17243..57b095c91 100644 --- a/app/src/main/res/menu/web_view.xml +++ b/app/src/main/res/menu/web_view.xml @@ -2,6 +2,12 @@ + +