apache/incubator-cordova-ios — pull request #19 by RandyMcMillan (2012-05-20 14:40:44+00:00)
Title: openInSafari

https://issues.apache.org/jira/browse/CB-362

Adding

-(BOOL)webView:(UIWebView *)webView
shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType;
{
NSURL *requestURL =[ [ request URL ] retain ];
if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [
requestURL scheme ] isEqualToString: @"https" ] || [ [ requestURL
scheme ] isEqualToString: @"mailto" ])
&& ( navigationType == UIWebViewNavigationTypeLinkClicked ) ) {
return ![ [ UIApplication sharedApplication ] openURL: [
requestURL autorelease ] ];
}
[ requestURL release ];
return YES;
}

to the MainViewController.m works like a charm.

Maybe i'm misinterpreting the issue.

Additionally

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
{
NSURL *requestURL =[ [ request URL ] retain ];
if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [ requestURL scheme ] isEqualToString: @"https" ] || [ [ requestURL scheme ] isEqualToString: @"mailto" ])
&& ( navigationType == UIWebViewNavigationTypeLinkClicked || navigationType == UIWebViewNavigationTypeOther ) ) {
return ![ [ UIApplication sharedApplication ] openURL: [ requestURL autorelease ] ];
}
[ requestURL release ];
return YES;
}

the

|| navigationType == UIWebViewNavigationTypeOther maybe be added.