GH-417: Handle non-default target attribute values (e.g. target=on links in WKWebView implementation on iOS (#418)
This commit is contained in:
parent
6db2f2d324
commit
9f4b72982a
@ -573,7 +573,14 @@ static CDVWKInAppBrowser* instance = nil;
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(shouldStart){
|
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{
|
}else{
|
||||||
decisionHandler(WKNavigationActionPolicyCancel);
|
decisionHandler(WKNavigationActionPolicyCancel);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user