Created attachment 304404 [details]
WKWebView conforms to NSCoding protocol, but despite that encoding and decoding WKWebView object does not preserve WKBackForwardNavigationList
Steps to Reproduce:
1.) Build and run attached test app
2.) Search for puppies
3.) Quit the app (double press on Home button and flick the app)
4.) Launch the app again
5.) Use Side Swipe gesture to go back
Test app should go back to google.com
There is no back navigation entry
No such thing as a "WKBackForwardNavigationList"
I'll assume you meant WKBackForwardList and retitle
Note: WKWebView's NSCoding support is known to be lacking in many, many ways - Not only this way.
The solution for saving/restoring the back forward list would be to expose _WKSessionState (or something like it) as API.
Thank you for commenting. Sorry, I indeed meant WKBackForwardList. Any way to restore navigation session would work for us, conforming to NSCoding was just a suggested example.
I assume Eugene is asking for the same reason that the Firefox for iOS team is also exploring this API today:
iOS 11 has severely regressed WebKit rendering: we are getting lots and lots of reports of users who are only seeing half rendered pages. On both iPad and iPhone. With both 1 tab and multiple tabs.
This is reported / docuemnted at:
The workaround for this regression is to completely deallocate the WKWebView and then put a new instance in the view hierarchy.
This of course loses all state, so we too are exploring if NSCoding support is good enough for this workaround.
Both Chrome and FIrefox have super hacky workarounds in place for back forward list saving / restoring.
I hope this background is useful to give some insight in the sudden interest in this functionality.