From 7f545a19dcb52073bc22d2bb59e6cb4beecac4a6 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Fri, 28 Dec 2018 22:15:08 -0500 Subject: Switch default user agent to android, resolves #1245, #1229 --- app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt index b15ad5cf..0e9d94e6 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt @@ -28,7 +28,9 @@ import com.pitchedapps.frost.contracts.FrostContentContainer import com.pitchedapps.frost.contracts.FrostContentCore import com.pitchedapps.frost.contracts.FrostContentParent import com.pitchedapps.frost.facebook.FB_HOME_URL +import com.pitchedapps.frost.facebook.FbItem import com.pitchedapps.frost.facebook.USER_AGENT_BASIC +import com.pitchedapps.frost.facebook.USER_AGENT_FULL import com.pitchedapps.frost.fragments.WebFragment import com.pitchedapps.frost.utils.Prefs import com.pitchedapps.frost.utils.frostDownload @@ -63,8 +65,9 @@ class FrostWebView @JvmOverloads constructor( @SuppressLint("SetJavaScriptEnabled") override fun bind(container: FrostContentContainer): View { - if (parent.baseEnum != null || parent.baseUrl.shouldUseBasicAgent) - userAgentString = USER_AGENT_BASIC // go through our own agent ref + userAgentString = + if (parent.baseEnum == FbItem.MESSAGES || parent.baseUrl.shouldUseBasicAgent) USER_AGENT_BASIC + else USER_AGENT_FULL with(settings) { javaScriptEnabled = true allowFileAccess = true -- cgit v1.2.3