|
|
@ -6,10 +6,7 @@ import android.os.Bundle |
|
|
|
import android.view.Menu |
|
|
|
import android.view.Menu |
|
|
|
import android.view.MenuItem |
|
|
|
import android.view.MenuItem |
|
|
|
import android.view.View |
|
|
|
import android.view.View |
|
|
|
import android.webkit.CookieManager |
|
|
|
import android.webkit.* |
|
|
|
import android.webkit.WebSettings |
|
|
|
|
|
|
|
import android.webkit.WebView |
|
|
|
|
|
|
|
import android.webkit.WebViewClient |
|
|
|
|
|
|
|
import androidx.fragment.app.activityViewModels |
|
|
|
import androidx.fragment.app.activityViewModels |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.BaseFragment |
|
|
|
import io.legado.app.base.BaseFragment |
|
|
@ -88,6 +85,16 @@ class WebViewLoginFragment : BaseFragment(R.layout.fragment_web_view_login) { |
|
|
|
super.onPageFinished(view, url) |
|
|
|
super.onPageFinished(view, url) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
binding.webView.webChromeClient = object : WebChromeClient() { |
|
|
|
|
|
|
|
override fun onJsAlert( |
|
|
|
|
|
|
|
view: WebView?, |
|
|
|
|
|
|
|
url: String?, |
|
|
|
|
|
|
|
message: String?, |
|
|
|
|
|
|
|
result: JsResult? |
|
|
|
|
|
|
|
): Boolean { |
|
|
|
|
|
|
|
return super.onJsAlert(view, url, message, result) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
source.loginUrl?.let { |
|
|
|
source.loginUrl?.let { |
|
|
|
binding.webView.loadUrl(it, source.getHeaderMap(true)) |
|
|
|
binding.webView.loadUrl(it, source.getHeaderMap(true)) |
|
|
|
} |
|
|
|
} |
|
|
|