阅读背景:

解决超链接添加 target="_blank"之后在WebView中不能打开

来源:互联网 

小竹小站:www.chinadev.cn

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification

{


    [webViewsetUIDelegate:self];

}


- (WebView *)webView:(WebView *)sender createWebViewWithRequest:(NSURLRequest *)request

{

    NSLog(@"sss%@",sender);

    NSUInteger windowStyleMask =    NSClosableWindowMask | 

    NSMiniaturizableWindowMask |

    NSResizableWindowMask |

    NSTitledWindowMask;

    NSWindow * webWindow = [[NSWindow alloc] initWithContentRect:NSMakeRect(0, 0, 800, 600) styleMask:windowStyleMask backing:NSBackingStoreBuffereddefer:NO];

    WebView * newWebView = [[WebView alloc] initWithFrame:[webWindow contentRectForFrameRect:webWindow.frame]];

    [newWebView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];

    [webWindow setContentView:newWebView];

    [webWindow center];

    [webWindow makeKeyAndOrderFront:self];

    [[newWebView mainFrame] loadRequest:request];

    return newWebView;

}
- (void)applicationDidFi



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: