fix:内置浏览器headmap未设置

pull/1778/head
Xwite 3 years ago
parent de027e9d31
commit ccbe25350e
  1. 11
      app/src/main/java/io/legado/app/ui/login/WebViewLoginFragment.kt

@ -44,8 +44,10 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) {
if (!checking) {
checking = true
binding.titleBar.snackbar(R.string.check_host_cookie)
viewModel.source?.loginUrl?.let {
binding.webView.loadUrl(it)
viewModel.source?.let { source ->
source.loginUrl?.let {
binding.webView.loadUrl(it, source.getHeaderMap(true))
}
}
}
}
@ -57,9 +59,6 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) {
binding.webView.settings.apply {
builtInZoomControls = true
javaScriptEnabled = true
source.getHeaderMap()[AppConst.UA_NAME]?.let {
userAgentString = it
}
}
val cookieManager = CookieManager.getInstance()
source.loginUrl?.let {
@ -82,7 +81,7 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) {
}
}
source.loginUrl?.let {
binding.webView.loadUrl(it)
binding.webView.loadUrl(it, source.getHeaderMap(true))
}
}

Loading…
Cancel
Save