1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-09 20:42:34 +01:00

Support messenger usage when default apps are enabled

This commit is contained in:
Allan Wang 2021-10-09 17:31:55 -07:00
parent 3b6de26ee1
commit 30c45b6120
No known key found for this signature in database
GPG Key ID: 69D90B885D405BDB
3 changed files with 17 additions and 1 deletions

View File

@ -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

View File

@ -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

View File

@ -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" }