I want to access/clear the back forward list as if the UIWebView is new again. Is there any public API or workaround to do this?
I\'ve tried:
I've tried almost every solution posted without much success. My case is for Childbrowser phonegap plugin, but is based in the same problem, a single webview instance used to show external pages in my application. When I show an external page, the webview maintains the history of previous pages shown. I wanted to remove the history when I show a new external webpage.
After some research, I've found a solution in this SO post that worked for me.
[webView stringByEvaluatingJavaScriptFromString:@"document.body.innerHTML = \"\";"];
In the case of childbrowser, I placed it in the method -(IBAction) onDoneButtonPress:(id)sender, which previously inserted a blank page to start blank (but with back button enabled).
HTH! Milton.