WebKit's WKWebView should allow overriding http/https WKURLSchemeHandlers

Originator:heath.borders
Number:rdar://32759258 Date Originated:June 14 2017, 12:35 AM
Status: Resolved:
Product:iOS + SDK Product Version:
Classification: Reproducible:Always
 
Area:
WebKit

Summary:
I've built many iOS apps that used NSURLProtocols to override UIWebView content loading, and I'd love to use WKWebView instead. Most of them used caching logic to store responses to disk and reload later if no network was available. These apps can't use custom URL schemes because they have to support arbitrary pages. Other apps I've built relied on proprietary network security rules. Again, they still need to work with pages built for standard websites, but they need custom logic for some resource loads.

Ideally, I could override the http and https WKURLSchemeHandlers with my own logic and delegate back to standard WKURLSchemeHandlers if necessary.

In the caching example, I would delegate to a standard http handler, but if the resource load failed, I would attempt to load the resource from a disk cache.

In the proprietary network security rules example, I had to perform some custom security API calls with only the first https resource load. Subsequent loads could use the standard https handler, except I would need to add a header to the standard URLRequest.

Steps to Reproduce:
N/A

Expected Results:
N/A

Observed Results:
N/A

Version:
iOS 11

Notes:
N/A

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!