aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-08-15 19:53:57 -0700
committerGitHub <noreply@github.com>2017-08-15 19:53:57 -0700
commit2eaad9b72746d57c187d2ded7f40d803f88dfcee (patch)
treebab40fa1cd7e9fd4bba8fd59b562207010fc58ba /app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
parent19ec9b543e15fe453b576f1b38994b3f8692054f (diff)
downloadfrost-2eaad9b72746d57c187d2ded7f40d803f88dfcee.tar.gz
frost-2eaad9b72746d57c187d2ded7f40d803f88dfcee.tar.bz2
frost-2eaad9b72746d57c187d2ded7f40d803f88dfcee.zip
Enhancement/url redirect manager (#182)
* Initial blacklist * Move js checks to java * Optimize imports and clean up request interceptor
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt5
1 files changed, 5 insertions, 0 deletions
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 ad9340d7..4094a3ab 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/utils/Utils.kt
@@ -54,6 +54,11 @@ fun Activity.cookies(): ArrayList<CookieModel> {
return intent?.extras?.getParcelableArrayList<CookieModel>(EXTRA_COOKIES) ?: arrayListOf()
}
+/**
+ * Launches the given url in a new overlay (if it already isn't in an overlay)
+ * Note that most requests may need to first check if the url can be launched as an overlay
+ * See [requestWebOverlay] to verify the launch
+ */
fun Context.launchWebOverlay(url: String) {
val argUrl = url.formattedFbUrl
L.v("Launch received", url)