|
|
@ -13,6 +13,7 @@ import androidx.webkit.WebSettingsCompat |
|
|
|
import androidx.webkit.WebViewFeature |
|
|
|
import androidx.webkit.WebViewFeature |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
import io.legado.app.base.VMBaseActivity |
|
|
|
|
|
|
|
import io.legado.app.constant.AppConst |
|
|
|
import io.legado.app.databinding.ActivityRssReadBinding |
|
|
|
import io.legado.app.databinding.ActivityRssReadBinding |
|
|
|
import io.legado.app.help.config.AppConfig |
|
|
|
import io.legado.app.help.config.AppConfig |
|
|
|
import io.legado.app.lib.dialogs.SelectItem |
|
|
|
import io.legado.app.lib.dialogs.SelectItem |
|
|
@ -177,6 +178,9 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel> |
|
|
|
upJavaScriptEnable() |
|
|
|
upJavaScriptEnable() |
|
|
|
val url = NetworkUtils.getAbsoluteURL(it.origin, it.link) |
|
|
|
val url = NetworkUtils.getAbsoluteURL(it.origin, it.link) |
|
|
|
val html = viewModel.clHtml(content) |
|
|
|
val html = viewModel.clHtml(content) |
|
|
|
|
|
|
|
binding.webView.settings.userAgentString = |
|
|
|
|
|
|
|
viewModel.rssSource?.getHeaderMap()?.get(AppConst.UA_NAME, true) |
|
|
|
|
|
|
|
?: AppConfig.userAgent |
|
|
|
if (viewModel.rssSource?.loadWithBaseUrl == true) { |
|
|
|
if (viewModel.rssSource?.loadWithBaseUrl == true) { |
|
|
|
binding.webView |
|
|
|
binding.webView |
|
|
|
.loadDataWithBaseURL(url, html, "text/html", "utf-8", url)//不想用baseUrl进else |
|
|
|
.loadDataWithBaseURL(url, html, "text/html", "utf-8", url)//不想用baseUrl进else |
|
|
|