Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to intercept all http(s) requests on ios WKWebView?

Tags:

ios

wkwebview

I'm having an Android app that relies heavily on shouldIntercept on the WebView ported to iOS ideally using WKWebView. Is there a way to implement something similar to shouldIntercept for all http and https calls?

Edit: the android webview will let me intercept all resources, images, videos, html, Javascript, etc. Is there some way to do that on ios?

like image 793
casolorz Avatar asked Oct 17 '25 13:10

casolorz


1 Answers

Take a look at this github repository called as WKWebViewWithURLProtocol Casolorz. This library enables you to use NSURLProtocol to intercept your network requests using method swizzling.

like image 92
Rizwan Ahmed Avatar answered Oct 20 '25 04:10

Rizwan Ahmed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!