1

To be specific: If I want download a html-page, there are many requests to image, music, js, etc, which I cannot handle by UIWebView delegates.

To be more specific: I'm interested in handling of ajax-requests! I have tried to implement ajax-handler by injecting javascript in every loaded html-page (source: UIWebViewDelegate not monitoring XMLHttpRequest?), but this is not working (iOS 5.1.1).

I think there are solution by implementing subclass of NSURLProtocol (simple proxy), but I dont know how.

Please help!

Community
  • 1
  • 1
bezigon
  • 518
  • 7
  • 17
  • 1
    There is demo for you, the OnionBrowser: click [here](https://github.com/mtigas/iOS-OnionBrowser/blob/master/OnionBrowser/ProxyURLProtocol.m) I think it is helpful for you. – Rommel Oct 16 '12 at 07:35

1 Answers1

1

I had to do something very similar and managed to get it working by implementing a NSURLProtocol and forcing the response to load a local json file.

You can see the full implementation here :

How to mock AJAX call with NSURLProtocol?

Community
  • 1
  • 1
vdaubry
  • 11,369
  • 7
  • 54
  • 76