ServiceWorkerWebSettings
abstract class ServiceWorkerWebSettings
kotlin.Any | |
↳ | android.webkit.ServiceWorkerWebSettings |
Manages settings state for all Service Workers. These settings are not tied to the lifetime of any WebView because service workers can outlive WebView instances. The settings are similar to WebSettings
but only settings relevant to Service Workers are supported.
Summary
Public constructors | |
---|---|
Public methods | |
---|---|
abstract Boolean |
Gets whether Service Workers support content URL access. |
abstract Boolean |
Gets whether Service Workers support file access. |
abstract Boolean |
Gets whether Service Workers are prohibited from loading any resources from the network. |
abstract Int |
Gets the current setting for overriding the cache mode. |
abstract Unit |
setAllowContentAccess(allow: Boolean) Enables or disables content URL access from Service Workers, see |
abstract Unit |
setAllowFileAccess(allow: Boolean) Enables or disables file access within Service Workers, see |
abstract Unit |
setBlockNetworkLoads(flag: Boolean) Sets whether Service Workers should not load resources from the network, see |
abstract Unit |
setCacheMode(mode: Int) Overrides the way the cache is used, see |
Public constructors
ServiceWorkerWebSettings
ServiceWorkerWebSettings()
Public methods
getAllowContentAccess
abstract fun getAllowContentAccess(): Boolean
Gets whether Service Workers support content URL access.
See Also
getAllowFileAccess
abstract fun getAllowFileAccess(): Boolean
Gets whether Service Workers support file access.
See Also
getBlockNetworkLoads
abstract fun getBlockNetworkLoads(): Boolean
Gets whether Service Workers are prohibited from loading any resources from the network.
Return | |
---|---|
Boolean |
true if the Service Workers are not allowed to load any resources from the network |
See Also
getCacheMode
abstract fun getCacheMode(): Int
Gets the current setting for overriding the cache mode.
Return | |
---|---|
Int |
the current setting for overriding the cache mode Value is android.webkit.WebSettings#LOAD_DEFAULT , android.webkit.WebSettings#LOAD_NORMAL , android.webkit.WebSettings#LOAD_CACHE_ELSE_NETWORK , android.webkit.WebSettings#LOAD_NO_CACHE , or android.webkit.WebSettings#LOAD_CACHE_ONLY |
See Also
setAllowContentAccess
abstract fun setAllowContentAccess(allow: Boolean): Unit
Enables or disables content URL access from Service Workers, see WebSettings#setAllowContentAccess
.
setAllowFileAccess
abstract fun setAllowFileAccess(allow: Boolean): Unit
Enables or disables file access within Service Workers, see WebSettings#setAllowFileAccess
.
setBlockNetworkLoads
abstract fun setBlockNetworkLoads(flag: Boolean): Unit
Sets whether Service Workers should not load resources from the network, see WebSettings#setBlockNetworkLoads
.
Parameters | |
---|---|
flag |
Boolean: true means block network loads by the Service Workers |
setCacheMode
abstract fun setCacheMode(mode: Int): Unit
Overrides the way the cache is used, see WebSettings#setCacheMode
.
Parameters | |
---|---|
mode |
Int: the mode to use. One of WebSettings#LOAD_DEFAULT , WebSettings#LOAD_CACHE_ELSE_NETWORK , WebSettings#LOAD_NO_CACHE or WebSettings#LOAD_CACHE_ONLY . The default value is WebSettings#LOAD_DEFAULT . Value is android.webkit.WebSettings#LOAD_DEFAULT , android.webkit.WebSettings#LOAD_NORMAL , android.webkit.WebSettings#LOAD_CACHE_ELSE_NETWORK , android.webkit.WebSettings#LOAD_NO_CACHE , or android.webkit.WebSettings#LOAD_CACHE_ONLY |