Intercepting spawned URL requests from UIWebView
I'm trying to cache specified web pages to disk by NSURLProtocol,now I can only get the first URL request, but the UIWebView spawns further URL requests for loading graphics. So how can I Intercept all the requests spawned by UIWebView from the first URL? Thank you very much!
Implement delegate method
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
every time your webview loads url it will first call this method.
链接地址: http://www.djcxy.com/p/34798.html上一篇: WKWebView和NSURLProtocol不起作用
下一篇: 拦截UIWebView衍生的URL请求