useShouldInterceptAjaxRequest property

bool? useShouldInterceptAjaxRequest
getter/setter pair

Set to true to be able to listen at the PlatformWebViewCreationParams.shouldInterceptAjaxRequest event.

Due to the async nature of PlatformWebViewCreationParams.shouldInterceptAjaxRequest event implementation, it will intercept only async XMLHttpRequests (AjaxRequest.isAsync with true). To be able to intercept sync XMLHttpRequests, use InAppWebViewSettings.interceptOnlyAsyncAjaxRequests to false. If necessary, you should implement your own logic using for example an UserScript overriding the XMLHttpRequest JavaScript object.

If the PlatformWebViewCreationParams.shouldInterceptAjaxRequest event is implemented and this value is null, it will be automatically inferred as true, otherwise, the default value is false. This logic will not be applied for PlatformInAppBrowser, where you must set the value manually.

Officially Supported Platforms/Implementations:

  • Android WebView
  • iOS WKWebView
  • macOS WKWebView

Implementation

bool? useShouldInterceptAjaxRequest;