incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Randy McMillan (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CB-362) [ios] target="_blank" links should open in browser (ignoring externalhosts)
Date Sun, 20 May 2012 14:41:40 GMT

    [ https://issues.apache.org/jira/browse/CB-362?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13279781#comment-13279781
] 

Randy McMillan commented on CB-362:
-----------------------------------

-(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; 
}


Adding this to the MainViewController.m works perfect. (Unless Ive missed something).


Submitted pull request https://github.com/apache/incubator-cordova-ios/pull/19




                
> [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
>
>
> 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

        

Mime
View raw message