GH-417: Handle non-default target attribute values (e.g. target=on links in WKWebView implementation on iOS (#418)

This commit is contained in:
Dave Alden 2019-02-10 17:06:35 +00:00 committed by Jan Piotrowski
parent 6db2f2d324
commit 9f4b72982a

View File

@ -573,7 +573,14 @@ static CDVWKInAppBrowser* instance = nil;
}
if(shouldStart){
decisionHandler(WKNavigationActionPolicyAllow);
// Fix GH-417: Handle non-default target attribute
// Based on https://stackoverflow.com/a/25853806/777265
if (!navigationAction.targetFrame.isMainFrame){
[theWebView loadRequest:navigationAction.request];
decisionHandler(WKNavigationActionPolicyCancel);
}else{
decisionHandler(WKNavigationActionPolicyAllow);
}
}else{
decisionHandler(WKNavigationActionPolicyCancel);
}