-
Notifications
You must be signed in to change notification settings - Fork 939
Closed
Description
WKWebView doesn't respect loading new windows (hrefs with target="_blank") like UIWebview did. So if I try to send a user to a page that opens one of its links in a new window, I get the "please disable popup blocker" toast notification.
Stops me from using this package for oauth sites that pop a new window up for the sign in process.
Seems there's an easy workaround in the WKUIDelegate to just capture those events and load them in the current view. I got this code from this stack overflow answer:
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
{
if (!navigationAction.targetFrame.isMainFrame) {
[webView loadRequest:navigationAction.request];
}
return nil;
}
Not sure how much work that would be to add to the plugin, but if that could be done it would be great.
Metadata
Metadata
Assignees
Labels
No labels