No API for recovering WKWebView from WebContent crash

Originator:cpickslay
Number:rdar://21334842 Date Originated:6/10/15
Status:Closed Resolved:6/12/15
Product:iOS SDK Product Version:8
Classification:Other Bug Reproducible:Always
 
Summary:
If the web process crashes when displaying a WKWebView, the view becomes blank and its URL property is nilled out. While better than crashing the process, this results in a poor user experience and makes it difficult to present a recovery option. The only clean solution I've found is uing KVO on the URL property to detect it being nilled out and present the option to load the page at that URL again.

Steps to Reproduce:
1. Open the attached project in Xcode 6.3 (Swift 1.2)
2. Compile and run the app in the iOS Simulator
3. Open Activity Monitor and search for the "com.apple.WebKit.WebContent" process.
4. Force-quit the WebContent process. 

Expected Results:
The web view goes blank and the URL field is nilled out. There is no API method to directly detect this condition.

Actual Results:
A delegate callback including the URL should be provided, so the containing application can offer to reload it.

Version:
XCode 6.3, iOS Simulator running iOS 8.3

Notes:
The attached project uses KVO to detect the URL property going from non-nil to nil, and passes the old value to loadRequest() on the web view. While this works, it feels like a hack and seems like the solution could break in future SDK updates. 

Configuration:
MacBook Pro Retina

Attachments:
'WKWebViewCrash.zip' was successfully uploaded.

Comments

Marked as duplicate of rdar://17358828


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!