diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt index f24a7a51..2abc9b25 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt @@ -25,10 +25,14 @@ class FrostJSI(val webView: FrostWebViewCore) { val cookies: ArrayList<CookieModel> get() = activity?.cookies() ?: arrayListOf() + /** + * Attempts to load the url in an overlay + * Returns {@code true} if successful, meaning the event is consumed, + * or {@code false} otherwise, meaning the event should be propagated + */ @JavascriptInterface - fun loadUrl(url: String) { - context.launchWebOverlay(url) - } + fun loadUrl(url: String?): Boolean + = if (url == null) false else context.requestWebOverlay(url) @JavascriptInterface fun reloadBaseUrl(animate: Boolean) { |