Am using the following https://github.com/apache/incubator-cordova-mac to make mac os x apps, but It seems that I cant get _blank links to open. If anyone knows how that would be great.
Answer 1) – did not work
I placed this in WebViewDelegate.m –
UIWebViewNavigationType < is the error
- (BOOL) webView:(WebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
{
//return [self.viewController webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
NSURL *url = [request URL];
// Intercept the external http requests and forward to Safari.app
// Otherwise forward to the PhoneGap WebView
if ([[url scheme] isEqualToString:@"http"] || [[url scheme] isEqualToString:@"https"] || [[url scheme] isEqualToString:@"itms-apps"]) {
[[UIApplication sharedApplication] openURL:url];
return NO;
}
else {
return [self.viewController webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
}
}
I think the _blank change is a recent one and not yet implemented in iOS. I currently use this piece of native code in
AppDelegate.mto open external URLs in Safari