ServiceWorkerController
public
abstract
class
ServiceWorkerController
extends Object
| java.lang.Object | |
| ↳ | android.webkit.ServiceWorkerController |
Manages Service Workers used by WebView.
Example usage:
ServiceWorkerController swController = ServiceWorkerController.getInstance();
swController.setServiceWorkerClient(new ServiceWorkerClient() {
@Override
public WebResourceResponse shouldInterceptRequest(WebResourceRequest request) {
// Capture request here and generate response or allow pass-through
// by returning null.
return null;
}
});
Summary
Public constructors | |
|---|---|
ServiceWorkerController()
|
|
Public methods | |
|---|---|
static
ServiceWorkerController
|
getInstance()
Returns the default ServiceWorkerController instance. |
abstract
ServiceWorkerWebSettings
|
getServiceWorkerWebSettings()
Gets the settings for all service workers. |
abstract
void
|
setServiceWorkerClient(ServiceWorkerClient client)
Sets the client to capture service worker related callbacks. |
Inherited methods | |
|---|---|
From
class
java.lang.Object
| |
Public constructors
Public methods
getInstance
ServiceWorkerController getInstance ()
Returns the default ServiceWorkerController instance. At present there is only one ServiceWorkerController instance for all WebView instances, however this restriction may be relaxed in the future.
| Returns | |
|---|---|
ServiceWorkerController |
the default ServiceWorkerController instance
This value will never be |
getServiceWorkerWebSettings
ServiceWorkerWebSettings getServiceWorkerWebSettings ()
Gets the settings for all service workers.
| Returns | |
|---|---|
ServiceWorkerWebSettings |
the current ServiceWorkerWebSettings
This value will never be |
setServiceWorkerClient
void setServiceWorkerClient (ServiceWorkerClient client)
Sets the client to capture service worker related callbacks.
A ServiceWorkerClient should be set before any service workers are
active, e.g. a safe place is before any WebView instances are created or
pages loaded.
| Parameters | |
|---|---|
client |
ServiceWorkerClient This value may be |
Annotations
Interfaces
Classes
- ClientCertRequest
- ConsoleMessage
- CookieManager
- CookieSyncManager
- DateSorter
- GeolocationPermissions
- HttpAuthHandler
- JsPromptResult
- JsResult
- MimeTypeMap
- PermissionRequest
- RenderProcessGoneDetail
- ServiceWorkerClient
- ServiceWorkerController
- ServiceWorkerWebSettings
- SslErrorHandler
- URLUtil
- WebBackForwardList
- WebChromeClient
- WebChromeClient.FileChooserParams
- WebHistoryItem
- WebIconDatabase
- WebMessage
- WebMessagePort
- WebMessagePort.WebMessageCallback
- WebResourceError
- WebResourceResponse
- WebSettings
- WebStorage
- WebStorage.Origin
- WebView
- WebView.HitTestResult
- WebView.VisualStateCallback
- WebView.WebViewTransport
- WebViewClient
- WebViewDatabase
- WebViewFragment
Enums

