From d0b4471667a3979deddf2c1e947cff301fb4d254 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 4 Apr 2019 21:28:41 -0400 Subject: Merge mute specific fixes (#1386) * Merge mute specific fixes * Remove version tag in user agent * Add extra forward slash * Update kau --- app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt | 4 ++-- app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt | 1 + app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps') diff --git a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt index 1d6937f7..8bca6b67 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/facebook/FbConst.kt @@ -22,7 +22,7 @@ package com.pitchedapps.frost.facebook const val FACEBOOK_COM = "facebook.com" const val FBCDN_NET = "fbcdn.net" -const val HTTPS_FACEBOOK_COM = "https://$FACEBOOK_COM" +const val HTTPS_FACEBOOK_COM = "https://$FACEBOOK_COM/" const val FB_URL_BASE = "https://m.$FACEBOOK_COM/" fun profilePictureUrl(id: Long) = "https://graph.facebook.com/$id/picture?type=large" const val FB_LOGIN_URL = "${FB_URL_BASE}login" @@ -30,7 +30,7 @@ const val FB_HOME_URL = "${FB_URL_BASE}home.php" // Default user agent const val USER_AGENT_FULL = - "Mozilla/5.0 (Linux; Android 7.1; Mi A1 Build/N2G47H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36" + "Mozilla/5.0 (Linux; Android 8.0.0; ONEPLUS A3000) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.90 Mobile Safari/537.36" // Basic user agent; non mobile version const val USER_AGENT_BASIC = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.110 Safari/537.36" 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 0e9d94e6..37b2234d 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/views/FrostWebView.kt @@ -70,6 +70,7 @@ class FrostWebView @JvmOverloads constructor( else USER_AGENT_FULL with(settings) { javaScriptEnabled = true + mediaPlaybackRequiresUserGesture = false // TODO check if we need this allowFileAccess = true textZoom = Prefs.webTextScaling } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt index 90c4c7e2..e278db80 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/DebugWebView.kt @@ -24,7 +24,7 @@ import android.util.AttributeSet import android.view.View import android.webkit.WebView import ca.allanwang.kau.utils.withAlpha -import com.pitchedapps.frost.facebook.USER_AGENT_BASIC +import com.pitchedapps.frost.facebook.USER_AGENT_FULL import com.pitchedapps.frost.injectors.CssHider import com.pitchedapps.frost.injectors.jsInject import com.pitchedapps.frost.utils.L @@ -53,9 +53,9 @@ class DebugWebView @JvmOverloads constructor( } @SuppressLint("SetJavaScriptEnabled") - fun setupWebview() { + private fun setupWebview() { settings.javaScriptEnabled = true - settings.userAgentString = USER_AGENT_BASIC + settings.userAgentString = USER_AGENT_FULL setLayerType(View.LAYER_TYPE_HARDWARE, null) webViewClient = DebugClient() isDrawingCacheEnabled = true -- cgit v1.2.3