[
https://issues.apache.org/jira/browse/CB-362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279833#comment-13279833
]
Randy McMillan edited comment on CB-362 at 5/20/12 6:26 PM:
------------------------------------------------------------
-(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" ] || [ [ requestURL scheme ] isEqualToString: @"tel"
] || [ [ requestURL scheme ] isEqualToString: @"maps" ])
&& ( /*navigationType == UIWebViewNavigationTypeLinkClicked ||*/
navigationType == UIWebViewNavigationTypeOther ) ) {
return ![ [ UIApplication sharedApplication ] openURL: [ requestURL
autorelease ] ];
}
[ requestURL release ];
return YES;
}
adding tel to the switch works. (didnt test maps)
tested using
<a href="tel:+1-800-275-2273">
Call Apple Customer Support at 1-800-275-2273
</a>
was (Author: randymcmillan):
-(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" ] || [ [ requestURL scheme ] isEqualToString: @"tel"
] || [ [ requestURL scheme ] isEqualToString: @"maps" ])
&& ( /*navigationType == UIWebViewNavigationTypeLinkClicked ||*/
navigationType == UIWebViewNavigationTypeOther ) ) {
return ![ [ UIApplication sharedApplication ] openURL: [ requestURL
autorelease ] ];
}
[ requestURL release ];
return YES;
}
adding tel to the switch works. (didnt test maps)
tested using
<a href="tel:+1-800-275-2273">
Call Apple Customer Support at 1-800-275-2273
</a>
This opens the possibility of apps better supporting things like "Open in
iBooks" etc...
> [ios] target="_blank" links should open in browser (ignoring externalhosts)
> ---------------------------------------------------------------------------
>
> Key: CB-362
> URL: https://issues.apache.org/jira/browse/CB-362
> Project: Apache Cordova
> Issue Type: Bug
> Components: iOS
> Affects Versions: 1.5.0
> Reporter: Andrew Lunny
> Assignee: Shazron Abdullah
> Labels: externalhosts, whitelist
> Fix For: 1.8.0
>
> Attachments: RandyMcMillan-openInSafari.zip
>
>
> A link such as this:
> {noformat}<a href="http://google.com" target="_blank">Google</a>{noformat}
> should open by default in the device's web browser, without being explicitly
> allowed in the plist (externalhosts).
> This is the current (and, imo, expected) behaviour on Android.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira