WKWebView requests cannot be handled by custom NSURLProtocol

Originator:andreamhuey
Number:rdar://17190141 Date Originated:05-Jun-2014
Status:Open Resolved:
Product:iOS Product Version:8.0 beta
Classification: Reproducible:YES
 
Requests originating from a WKWebView cannot be handled by a custom NSURLProtocol.

This technique previously worked with UIWebView.

Steps to Reproduce:
1. Register a custom NSURLProtocol subclass.
2. Instantiate a WKWebView.
3. Call -[WKWebView loadRequest:].

Expected Results:
The NSURLProtocol class can intercept and handle these requests.

Actual Results:
The NSURLProtocol callbacks are not called, and the requests cannot be handled.

Strangely, + [NSURLProtocol canInitWithRequest:] is called for every requests, but nothing else is.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!