|
@@ -73,6 +73,17 @@ static NSString *const MessageHanderName = @"ReactNative";
|
73
|
73
|
return self;
|
74
|
74
|
}
|
75
|
75
|
|
|
76
|
+/**
|
|
77
|
+ * See https://stackoverflow.com/questions/25713069/why-is-wkwebview-not-opening-links-with-target-blank/25853806#25853806 for details.
|
|
78
|
+ */
|
|
79
|
+- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
|
|
80
|
+{
|
|
81
|
+ if (!navigationAction.targetFrame.isMainFrame) {
|
|
82
|
+ [webView loadRequest:navigationAction.request];
|
|
83
|
+ }
|
|
84
|
+ return nil;
|
|
85
|
+}
|
|
86
|
+
|
76
|
87
|
- (void)didMoveToWindow
|
77
|
88
|
{
|
78
|
89
|
if (self.window != nil && _webView == nil) {
|