diff options
author | Allan Wang <me@allanwang.ca> | 2017-07-13 15:08:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-13 15:08:06 -0700 |
commit | 1d364a1f5a8322ce8fbe200fcc9f5a41f91b41e8 (patch) | |
tree | efef20bdba32bcd0fbbdd303dfd01018b4871e01 /app/src/main/kotlin/com/pitchedapps/frost/web | |
parent | 91119de328bf5f4e8c945f8fb470453319b9f0ed (diff) | |
download | frost-1d364a1f5a8322ce8fbe200fcc9f5a41f91b41e8.tar.gz frost-1d364a1f5a8322ce8fbe200fcc9f5a41f91b41e8.tar.bz2 frost-1d364a1f5a8322ce8fbe200fcc9f5a41f91b41e8.zip |
Only use basic user agent when necessary (#59)
* Log more iab and web chrome
* Only add basic user string for messages
* Clean up logging
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web')
3 files changed, 16 insertions, 8 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClient.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClient.kt index 363bf795..aab3a165 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClient.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostChromeClient.kt @@ -1,6 +1,8 @@ package com.pitchedapps.frost.web import android.net.Uri +import android.os.Message +import android.view.View import android.webkit.* import ca.allanwang.kau.utils.snackbar import com.pitchedapps.frost.contracts.ActivityWebContract @@ -39,10 +41,4 @@ class FrostChromeClient(webCore: FrostWebViewCore) : WebChromeClient() { return activityContract != null } - override fun onGeolocationPermissionsShowPrompt(origin: String, callback: GeolocationPermissions.Callback) { - super.onGeolocationPermissionsShowPrompt(origin, callback) - L.d("Geo prompt") - } - - }
\ No newline at end of file diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt index 5583c63d..7c0a6597 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebView.kt @@ -15,6 +15,7 @@ import ca.allanwang.kau.utils.visible import ca.allanwang.kau.utils.withAlpha import com.pitchedapps.frost.R import com.pitchedapps.frost.facebook.FbTab +import com.pitchedapps.frost.facebook.USER_AGENT_BASIC import com.pitchedapps.frost.utils.Prefs import io.reactivex.android.schedulers.AndroidSchedulers @@ -59,9 +60,9 @@ class FrostWebView @JvmOverloads constructor( baseEnum = enum with(settings) { javaScriptEnabled = true - userAgentString = com.pitchedapps.frost.facebook.USER_AGENT_BASIC + if (url.contains("com/message")) + userAgentString = USER_AGENT_BASIC allowFileAccess = true - defaultFontSize textZoom = Prefs.webTextScaling } setLayerType(View.LAYER_TYPE_HARDWARE, null) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt index 0a254c50..ce2daa07 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewClient.kt @@ -97,4 +97,15 @@ open class FrostWebViewClient(val webCore: FrostWebViewCore) : WebViewClient() { return super.shouldOverrideUrlLoading(view, request) } + override fun onPageCommitVisible(view: WebView?, url: String?) { + L.d("ASDF PCV") + super.onPageCommitVisible(view, url) + } + +// override fun onLoadResource(view: WebView, url: String) { +// L.v("Load resource $url") +// super.onLoadResource(view, url) +// } + + }
\ No newline at end of file |