aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2021-10-09 17:31:55 -0700
committerAllan Wang <me@allanwang.ca>2021-10-09 17:31:55 -0700
commit30c45b61204cafdbfe8c71505ae9b47ebbc7763e (patch)
tree10ab08211bab1d843cca0405fe3fb084434bde7d /app
parent3b6de26ee105959a5ea7ee5a782509c48f1f358d (diff)
downloadfrost-30c45b61204cafdbfe8c71505ae9b47ebbc7763e.tar.gz
frost-30c45b61204cafdbfe8c71505ae9b47ebbc7763e.tar.bz2
frost-30c45b61204cafdbfe8c71505ae9b47ebbc7763e.zip
Support messenger usage when default apps are enabled
Diffstat (limited to 'app')
-rw-r--r--app/src/main/AndroidManifest.xml12
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt3
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt3
3 files changed, 17 insertions, 1 deletions
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index b5ede813..62cf57e9 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -130,6 +130,18 @@
<data
android:host="www.facebook.com"
android:scheme="https" />
+ <data
+ android:host="messenger.com"
+ android:scheme="http" />
+ <data
+ android:host="messenger.com"
+ android:scheme="https" />
+ <data
+ android:host="www.messenger.com"
+ android:scheme="http" />
+ <data
+ android:host="www.messenger.com"
+ android:scheme="https" />
</intent-filter>
</activity>
<activity
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
index 896dd6aa..d655c458 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -314,6 +314,9 @@ fun Context.startActivityForUri(uri: Uri): Boolean {
if (url.isFacebookUrl && !url.isExplicitIntent) {
return false
}
+ if (url.isMessengerUrl) {
+ return false
+ }
val intent = Intent(
Intent.ACTION_VIEW,
uri.formattedFbUri
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
index d08f80a6..94300348 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
@@ -28,6 +28,7 @@ import com.pitchedapps.frost.utils.isFacebookUrl
import com.pitchedapps.frost.utils.isImageUrl
import com.pitchedapps.frost.utils.isIndependent
import com.pitchedapps.frost.utils.isIndirectImageUrl
+import com.pitchedapps.frost.utils.isMessengerUrl
import com.pitchedapps.frost.utils.isVideoUrl
import com.pitchedapps.frost.utils.launchImageActivity
import com.pitchedapps.frost.utils.launchWebOverlay
@@ -76,7 +77,7 @@ fun FrostWebView.requestWebOverlay(url: String): Boolean {
}
if (!prefs.overlayEnabled) return false
if (context is WebOverlayActivityBase) {
- val shouldUseDesktop = url.isFacebookUrl
+ val shouldUseDesktop = url.isFacebookUrl || url.isMessengerUrl
// already overlay; manage user agent
if (userAgentString != USER_AGENT_DESKTOP_CONST && shouldUseDesktop) {
L._i { "Switch to desktop agent overlay" }