java.lang.Object | |
↳ | com.tencent.smtt.sdk.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; } });
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ServiceWorkerController() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static ServiceWorkerController |
getInstance(Context context)
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.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
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.
Gets the settings for all service workers.
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.