Reputation: 2353
I've got an app loading a local HTML file. The HTML file loads a Google Map within an iFrame. The app has a back button which checks UIWebView.canGoBack and UIWebView.isLoading
Within webViewDidStartLoad and webViewDidFinishLoad I'm tracking outstanding loads as suggested here, so that once I've reached zero outstanding loads I can update the back button's state, etc.
On the first load of the control, once all webViewDidFinishLoads have occurred, canGoBack and isLoading will both return NO.
On the second load of the control, once all webViewDidFinishLoads have occurred, isLoading gets "hung" always returning YES, and (I assume as a result), canGoBack will also return YES even though it's at the top of the stack.
Attaching Safari's debugger I can confirm that there are no outstanding HTTP requests when isLoading is returning YES.
I note that others have seen bugs with canGoBack's behavior in iOS and Safari in the past.
Questions:
Upvotes: 2
Views: 714
Reputation: 49
I suffered from this issue also.I have a html page with an iframe inserted by javascript code.The src attribute is empty.I found when the iframe was attached to the dom tree, the UIWebView trigger shouldStartLoadWithRequest: with about:blank URL.After I remove the javascript code,everything works great.
Upvotes: 2