[修复] 订阅源JS注入失败 #451
This commit is contained in:
1 file changed
+16
@@ -589,6 +589,22 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onPageFinished(view: WebView, url: String?) {
|
||||||
|
super.onPageFinished(view, url)
|
||||||
|
view.title?.let { title ->
|
||||||
|
if (title != url && title != view.url && title.isNotBlank() && url != "about:blank") {
|
||||||
|
binding.titleBar.title = title
|
||||||
|
} else {
|
||||||
|
binding.titleBar.title = intent.getStringExtra("title")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
viewModel.rssSource?.injectJs?.let {
|
||||||
|
if (it.isNotBlank()) {
|
||||||
|
view.evaluateJavascript(it, null)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@SuppressLint("WebViewClientOnReceivedSslError")
|
@SuppressLint("WebViewClientOnReceivedSslError")
|
||||||
override fun onReceivedSslError(
|
override fun onReceivedSslError(
|
||||||
view: WebView?,
|
view: WebView?,
|
||||||
|
|||||||
Reference in new issue
Block a user