Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows cordova mac在safari中打开URL_Windows_Cordova_Safari_Hyperlink - Fatal编程技术网

Windows cordova mac在safari中打开URL

Windows cordova mac在safari中打开URL,windows,cordova,safari,hyperlink,Windows,Cordova,Safari,Hyperlink,我使用下面的内容制作mac os x应用程序,但似乎无法打开空白链接。如果有人知道那将是多么好 答案1)-不起作用 我把它放在WebViewDelegate.m中- UIWebViewNavigationType

我使用下面的内容制作mac os x应用程序,但似乎无法打开空白链接。如果有人知道那将是多么好

答案1)-不起作用

我把它放在WebViewDelegate.m中-

UIWebViewNavigationType<是错误


我认为"空白改变"是最近才出现的,还没有在iOS中实现。我目前在
AppDelegate.m
中使用这段本机代码在Safari中打开外部URL

- (BOOL) webView:(UIWebView*)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];
    }
}

在2.3.0 oO上运行'

- (BOOL) webView:(UIWebView*)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 [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
}}

嗯,我在Cordova应用程序中使用它,而不是在Cordova Mac组件中使用它。您可能需要调整代码,以便在组件而不是应用程序中使用。只需寻找等效的方法。
- (BOOL) webView:(UIWebView*)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 [ super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType ];
}}