@ -554,7 +554,7 @@ class AnalyzeUrl(
}
fun getUserAgent(): String {
return headerMap[UA_NAME] ?: AppConfig.userAgent
return headerMap.get(UA_NAME, true) ?: AppConfig.userAgent
fun isPost(): Boolean {
@ -188,6 +188,7 @@ class ReadRssActivity : VMBaseActivity<ActivityRssReadBinding, ReadRssViewModel>
viewModel.urlLiveData.observe(this) {
upJavaScriptEnable()
binding.webView.settings.userAgentString = it.getUserAgent()
binding.webView.loadUrl(it.url, it.headerMap)
@ -9,7 +9,7 @@ fun HashMap<String, *>.has(key: String, ignoreCase: Boolean = false): Boolean {
return false
fun HashMap<String, *>.get(key: String, ignoreCase: Boolean = false): Any? {
fun <T> HashMap<String, T>.get(key: String, ignoreCase: Boolean = false): T? {
for (item in this) {
if (key.equals(item.key, ignoreCase)) {
return item.value