aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-11-15 02:47:13 -0500
committerGitHub <noreply@github.com>2017-11-15 02:47:13 -0500
commit5a6bf455cb2e550c18f94d8aeaaa91c2260cb75a (patch)
treebe77ea3de84f549a612e22a0adb8785956e0ac56 /app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
parent98fb870bdabae28beabe99d1e49ad74ab9a5a1c2 (diff)
downloadfrost-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/FrostUrlOverlayValidator.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt7
1 files changed, 5 insertions, 2 deletions
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 e8f9fee9..d1f144a6 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt
@@ -18,7 +18,7 @@ import org.jetbrains.anko.runOnUiThread
* cannot be resolved on a new window and must instead
* by loaded in the current page
* This helper method will collect all known cases and launch the overlay accordingly
- * Returns {@code true} (default) if action is consumed, {@code false} otherwise
+ * Returns [true] (default) if action is consumed, [false] otherwise
*
* Note that this is not always called on the main thread!
* UI related methods should always be posted or they may not be properly executed.
@@ -28,7 +28,10 @@ import org.jetbrains.anko.runOnUiThread
* as we have no need of sending a new intent to the same activity
*/
fun FrostWebViewCore.requestWebOverlay(url: String): Boolean {
- if (url == "#") return false
+ if (url == "#" || !url.isIndependent) {
+ L.i("Forbid overlay switch", url)
+ return false
+ }
if (url.isVideoUrl && context is VideoViewHolder) {
L.i("Found video", url)
context.runOnUiThread { (context as VideoViewHolder).showVideo(url) }