Skip to content

Commit

Permalink
GH-417: Handle non-default target attribute values (e.g. target=on li…
Browse files Browse the repository at this point in the history
…nks in WKWebView implementation on iOS (#418)
  • Loading branch information
dpa99c authored and janpio committed Feb 10, 2019
1 parent 6db2f2d commit 9f4b729
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/ios/CDVWKInAppBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,14 @@ - (void)webView:(WKWebView *)theWebView decidePolicyForNavigationAction:(WKNavig
}

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);
}
Expand Down

0 comments on commit 9f4b729

Please sign in to comment.