diff options
Diffstat (limited to 'app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt')
-rw-r--r-- | app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt index 6dbc7c8d..15383a50 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/web/FrostWebViewCore.kt @@ -44,6 +44,22 @@ class FrostWebViewCore @JvmOverloads constructor( var baseEnum: FbItem? = null //only viewpager items should pass the base enum internal lateinit var frostWebClient: FrostWebViewClient + /** + * Wrapper to the main userAgentString to cache it. + * This decouples it from the UiThread + * + * Note that this defaults to null, but the main purpose is to + * check if we've set our own agent. + * + * A null value may be interpreted as the default value + */ + var userAgentString: String? = null + get() = field + set(value) { + field = value + settings.userAgentString = value + } + init { isNestedScrollingEnabled = true progressObservable = PublishSubject.create<Int>() |