onAjaxReadyStateChange method

  1. @override
FutureOr<AjaxRequestAction?>? onAjaxReadyStateChange(
  1. AjaxRequest ajaxRequest
)
override

Event fired whenever the readyState attribute of an XMLHttpRequest changes. It gives the host application a chance to abort the request. This event is implemented using JavaScript under the hood.

Due to the async nature of this event implementation, using it could cause some issues, so, be careful when using it. In this case, you should implement your own logic using for example an UserScript overriding the XMLHttpRequest JavaScript object.

ajaxRequest represents the XMLHttpRequest.

Officially Supported Platforms/Implementations:

  • Android WebView:
  • iOS WKWebView
  • macOS WKWebView

Parameters - Officially Supported Platforms/Implementations:

  • ajaxRequest: all platforms

Use the PlatformInAppBrowserEvents.isMethodSupported method to check if this method is supported at runtime.

Implementation

@override
FutureOr<AjaxRequestAction?>? onAjaxReadyStateChange(
  AjaxRequest ajaxRequest,
) {
  return null;
}