Our iOS application has a web view that displays pages from a file: URL. When the user touches the <A> element to switch pages, about 20% of the time, he gets stuck as follows:
- Disable user
<A> link - We get a WebView.shouldStartLoadWithRequest callback
- We get a WebView.webViewDidStartLoad callback
- nothing happens after that
The screen still shows the original page with a link to it. We can break the trap in two ways:
- Rotate device
- Touch screen
At this point, the page will complete the download immediately.
We used the recipe from here:
Javascript console.log () on iOS UIWebView
to give us some idea about loading the page. We put the javascript-side material directly in the first script file that we load on the page, and it does not print its message until we get around the workaround.
So, it looks like he's stuck somewhere between the start of the page loading and is starting to evaluate the material on the page.
We tried a number of workflows, none of which helped:
- Setting location.href instead of using a tag
- Setting location.href from javascript timeout
- In the didStartLoad callback, a thread was created that called setNeedDisplay in the webView over and over again
Any idea what we can do wrong?
source share