diff options
author | Allan Wang <me@allanwang.ca> | 2018-12-28 22:15:08 -0500 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2018-12-28 22:15:08 -0500 |
commit | 7f545a19dcb52073bc22d2bb59e6cb4beecac4a6 (patch) | |
tree | 19f1458e408da149291ea7260b2196576ece0de9 /app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | |
parent | 9c3d7c8b6cca17dc10fc310d41e547d1fe1725ea (diff) | |
download | frost-7f545a19dcb52073bc22d2bb59e6cb4beecac4a6.tar.gz frost-7f545a19dcb52073bc22d2bb59e6cb4beecac4a6.tar.bz2 frost-7f545a19dcb52073bc22d2bb59e6cb4beecac4a6.zip |
Switch default user agent to android, resolves #1245, #1229
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 7 |
1 files changed, 5 insertions, 2 deletions
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 |