aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
diff options
context:
space:
mode:
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.kt9
1 files changed, 8 insertions, 1 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 bb482c3c..f81c6a15 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostJSI.kt
@@ -19,8 +19,15 @@ class FrostJSI(val context: Context, val webView: FrostWebViewCore) {
val cookies: ArrayList<CookieModel>
get() = (context as? MainActivity)?.cookies() ?: arrayListOf()
+ var lastUrl: String = ""
+
@JavascriptInterface
- fun loadUrl(url: String) = context.launchWebOverlay(url)
+ fun loadUrl(url: String) {
+ if (url != lastUrl) {
+ lastUrl = url
+ context.launchWebOverlay(url)
+ }
+ }
@JavascriptInterface
fun reloadBaseUrl(animate: Boolean) {