diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt index 51e1ca960..5a24ef605 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt @@ -54,18 +54,21 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application) { private fun loadContent(rssArticle: RssArticle, ruleContent: String) { execute { - AnalyzeUrl(rssArticle.link, baseUrl = rssArticle.origin).getResponseAwait().body() - ?.let { body -> - AnalyzeRule().apply { - setContent( - body, - NetworkUtils.getAbsoluteURL(rssArticle.origin, rssArticle.link) - ) - getString(ruleContent).let { content -> - contentLiveData.postValue(content) - } + val analyzeUrl = AnalyzeUrl(rssArticle.link, baseUrl = rssArticle.origin) + val content = if (analyzeUrl.useWebView) { + analyzeUrl.getResultByWebView(rssArticle.origin).content + } else analyzeUrl.getResponseAwait().body() + content?.let { body -> + AnalyzeRule().apply { + setContent( + body, + NetworkUtils.getAbsoluteURL(rssArticle.origin, rssArticle.link) + ) + getString(ruleContent).let { content -> + contentLiveData.postValue(content) } } + } } }