aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt')
-rw-r--r--app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt30
1 files changed, 3 insertions, 27 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
index 960fe4c2..8c016e5c 100644
--- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
+++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClients.kt
@@ -20,30 +20,6 @@ import io.reactivex.subjects.Subject
*/
/**
- * Fully quiet client that disables any prompts relating to the UI
- * (as nothing is attached)
- */
-class HeadlessChromeClient : WebChromeClient() {
-
- override fun onConsoleMessage(consoleMessage: ConsoleMessage) = true
-
- override fun onJsAlert(view: WebView, url: String?, message: String?, result: JsResult): Boolean {
- result.cancel()
- return true
- }
-
- override fun onJsConfirm(view: WebView, url: String?, message: String?, result: JsResult): Boolean {
- result.cancel()
- return true
- }
-
- override fun onJsPrompt(view: WebView, url: String?, message: String?, defaultValue: String?, result: JsPromptResult): Boolean {
- result.cancel()
- return true
- }
-}
-
-/**
* The default chrome client
*/
class FrostChromeClient(web: FrostWebView) : WebChromeClient() {
@@ -55,7 +31,7 @@ class FrostChromeClient(web: FrostWebView) : WebChromeClient() {
override fun onConsoleMessage(consoleMessage: ConsoleMessage): Boolean {
if (consoleBlacklist.any { consoleMessage.message().contains(it) }) return true
- L.v("Chrome Console ${consoleMessage.lineNumber()}: ${consoleMessage.message()}")
+ L.v { "Chrome Console ${consoleMessage.lineNumber()}: ${consoleMessage.message()}" }
return true
}
@@ -76,9 +52,9 @@ class FrostChromeClient(web: FrostWebView) : WebChromeClient() {
}
override fun onGeolocationPermissionsShowPrompt(origin: String, callback: GeolocationPermissions.Callback) {
- L.i("Requesting geolocation")
+ L.i { "Requesting geolocation" }
context.kauRequestPermissions(PERMISSION_ACCESS_FINE_LOCATION) { granted, _ ->
- L.i("Geolocation response received; ${if (granted) "granted" else "denied"}")
+ L.i { "Geolocation response received; ${if (granted) "granted" else "denied"}" }
callback(origin, granted, true)
}
}