Scrungepipes
Scrungepipes

Reputation: 37590

UIWebViewDeletate shouldStartLoadWithRequest: gets called multiple times with redirection requests

I'm using a UIWebView to display html pages which contain links, some of the links are to local files (file://...) and some are to remote web site (http://... ).

For some sites shouldStartLoadWithRequest gets called twice, for example if the html contains:

<a href="http://www.zagat.com/Verticals/PropertyDetails.aspx?VID=8&R=36121">

Then shouldStartLoadWithRequest gets called as expected with a request of

"www.zagat.com/Verticals/PropertyDetails.aspx?VID=8&R=36121"

But then it gets called again but this time with a redirection request of

"http://zagat.mobi/"

Is it possible to get feedback from the UIWebView when this is happening?

Upvotes: 1

Views: 2384

Answers (1)

PengOne
PengOne

Reputation: 48398

This happens when a site redirects you to their mobile version. I just tested this in the Safari iPhone App with the link you posted and it indeed redirects to Zagat's mobile site. Some websites are smarter than others as to where you get redirected. You can force the page to load the non-mobile version by not allowing redirects.

Upvotes: 1

Related Questions