diff options
author | Allan Wang <me@allanwang.ca> | 2017-11-15 02:47:13 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-15 02:47:13 -0500 |
commit | 5a6bf455cb2e550c18f94d8aeaaa91c2260cb75a (patch) | |
tree | be77ea3de84f549a612e22a0adb8785956e0ac56 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt | |
parent | 98fb870bdabae28beabe99d1e49ad74ab9a5a1c2 (diff) | |
download | frost-5a6bf455cb2e550c18f94d8aeaaa91c2260cb75a.tar.gz frost-5a6bf455cb2e550c18f94d8aeaaa91c2260cb75a.tar.bz2 frost-5a6bf455cb2e550c18f94d8aeaaa91c2260cb75a.zip |
Fix/bad overlay (#490)v1.6.5
* Fix intent launching
* Add some tests and update kotlin
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt index c8c7e2e7..67881ada 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClients.kt @@ -144,15 +144,15 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : BaseWebViewClient L.i("Url Loading", request.url?.toString()) val path = request.url?.path ?: return super.shouldOverrideUrlLoading(view, request) L.v("Url Loading Path", path) - request.url?.toString()?.apply { - if (contains("intent") && contains("com.facebook")) { - L.i("Skip facebook intent request") - return true - } + val url = request.url.toString() + if (url.isExplicitIntent) { + if (!url.contains("com.facebook")) + view.context.resolveActivityForUri(request.url) + return true } if (path.startsWith("/composer/")) return launchRequest(request) - if (request.url.toString().contains("scontent-sea1-1.xx.fbcdn.net") && (path.endsWith(".jpg") || path.endsWith(".png"))) - return launchImage(request.url.toString()) + if (url.contains("scontent-sea1-1.xx.fbcdn.net") && (path.endsWith(".jpg") || path.endsWith(".png"))) + return launchImage(url) if (Prefs.linksInDefaultApp && view.context.resolveActivityForUri(request.url)) return true return super.shouldOverrideUrlLoading(view, request) } |