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

Loading…
Cancel
Save