shouldInterceptRequest property

Future<WebResourceResponse?> Function(WebResourceRequest request)? shouldInterceptRequest
final

Notify the host application of a resource request and allow the application to return the data. If the return value is null, the Service Worker will continue to load the resource as usual. Otherwise, the return response and data will be used.

This method is called only if AndroidWebViewFeature.SERVICE_WORKER_SHOULD_INTERCEPT_REQUEST is supported. You can check whether that flag is supported using AndroidWebViewFeature.isFeatureSupported.

request represents an object containing the details of the request.

NOTE: available on Android 24+.

Implementation

final Future<WebResourceResponse?> Function(WebResourceRequest request)?
    shouldInterceptRequest;