From 5a6bf455cb2e550c18f94d8aeaaa91c2260cb75a Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 15 Nov 2017 02:47:13 -0500 Subject: Fix/bad overlay (#490) * Fix intent launching * Add some tests and update kotlin --- .../kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostUrlOverlayValidator.kt') 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) } -- cgit v1.2.3