How to intercept all requests from WebView in Flutter (on iOS)?

276 Views Asked by At

I need to get urls and http headers for all http requests going out from WebView.

I tried to use flutter_inappwebview package, but it's method InAppWebView.shouldInterceptRequest works only on Android. As written in their docs: "On Android, you can also use the shouldInterceptRequest event...". But I need it to work also on iOS.

Also I tried to inject javascript code (with interceptors) using method InAppWebViewController.injectJavascriptFileFromAsset, but the injected javascript code is executed only one time (not for each request).

Also there is advice to use shouldInterceptFetchRequest method, but it intercepts not all requests (only fetch requests).

Any ideas?

0

There are 0 best solutions below