incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy McMillan <randy.lee.mcmil...@gmail.com>
Subject Re: API function: Open url in system web browser
Date Sun, 20 May 2012 17:32:05 GMT
Demo app for fix:

https://github.com/RandyMcMillan/openInSafari

This fix seems to work as expected.

Adding this to the MainViewController.m

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


provides the expected functionality


_self and _blank function correctly on *phonegap* in the whitelist.








Using the http://docs.phonegap.com subdomain in contrast to http://phonegap.com seemed to
be a rigorous test because it is on the same domain and tests _blank and _self adherence to
the whitelist

Also to further test this fix navigate thru the page and find an external link. You will see
that the whitelist is still in effect.

follow the phoengap.com link
then navigate to an external link for example the adobe terms of use link at the bottom of
the page. 













Mime
View raw message