nsurlprotocol

How can i monitor requests on WKWebview?

无人久伴 提交于 2019-11-27 06:21:19
How can i monitor requests on WKWebview? I'v tried using NSURLprotocol (canInitWithRequest) but it won't monitor ajax requests (XHR), only navigation requests(document requests) Benzi Heler Finally I solved it Since I don't have control over the web view content, I injected to the WKWebview a java script that include a jQuery AJAX request listener. When the listener catches a request it sends the native app the request body in the method: webkit.messageHandlers.callbackHandler.postMessage(data); The native app catches the message in a delegate called: (void)userContentController:

How to play movie with a URL using a custom NSURLProtocol?

血红的双手。 提交于 2019-11-27 00:49:20
问题 As you know,play a movie with MPMoviePlayerController object using [[MPMoviePlayerController alloc] initWithContentURL: aURL]; now ,i want to achieve a custom NSURLProtocol in which i will decrypt a movie source that had be encrypt by AlgorithmDES. Is that possibility? thanks for giving any ideas.need you help~ 回答1: UPDATE: I spoke to Apple about this and it's not possible to use MPMoviePlayerController with a NSURLProtocol subclass at the moment! Hej, I am not sure but it could be possible.

NSURLConnection delegate methods are not called

≯℡__Kan透↙ 提交于 2019-11-26 19:17:29
问题 I am trying to create a simple NSURLConnection to communicate with a server using a GET request. Connection works well, but delegates methods of NSURLConnection are never called.. Here is what am doing: NSString *post = [NSString stringWithFormat:@"key1=%@&key2=%@&key3=%f&key4=%@", val1, val4, val3, val4]; NSMutableURLRequest *request = [[[NSMutableURLRequest alloc] init] autorelease] ; [request setURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://www.domain.com/demo/name/file.php?

How can i monitor requests on WKWebview?

好久不见. 提交于 2019-11-26 11:57:10
问题 How can i monitor requests on WKWebview? I\'v tried using NSURLprotocol (canInitWithRequest) but it won\'t monitor ajax requests (XHR), only navigation requests(document requests) 回答1: Finally I solved it Since I don't have control over the web view content, I injected to the WKWebview a java script that include a jQuery AJAX request listener. When the listener catches a request it sends the native app the request body in the method: webkit.messageHandlers.callbackHandler.postMessage(data);