Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't load target="_blank" links on iOS #269

Closed
aaronfg opened this issue Dec 13, 2018 · 6 comments
Closed

Can't load target="_blank" links on iOS #269

aaronfg opened this issue Dec 13, 2018 · 6 comments

Comments

@aaronfg
Copy link

aaronfg commented Dec 13, 2018

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.

@rydein
Copy link
Contributor

rydein commented Dec 17, 2018

I'm having same issue when I click the Ads.

@sameerbakre
Copy link

I do have same issue even on android. Its not opening _blank links there as well. Any suggestions. I am trying to open in javascript using following line.

window.open(myURL, "_blank");

@charafau charafau closed this as completed Sep 9, 2019
@MikeSWelch
Copy link

Why was this issue closed? The problem still occurs only on iOS in version 0.3.9+1.

@dimanshu
Copy link

and what about android ?

@MikeSWelch
Copy link

MikeSWelch commented Dec 16, 2019 via email

@dimanshu
Copy link

Trying to open popup window ,source
Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.
not opening new window screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants