Issue with popup on mobile and possible solution

Hi,
I’m having an issue with browsers blocking popups on mobile. I have applied the proposed workaround - uxMode: “redirect” instead of “popup”, but it’s not convenient to use.

Knowing that “window.open()” is not triggering the mobile block, I’ve tried debugging the issue in the source code. And found out (please see the screenshot below), that the root cause of this is Promise on line 367. When currentWindow.open() is called outside of the Promise constructor, the popup is shown normally.

Moreover, I’ve cloned and applied the fix for this myself. Please approve the PR below :slight_smile:
PR: fix: popup blocking on mobile browsers by SurenAvagyanG · Pull Request #275 · torusresearch/OpenLoginSdk · GitHub

@suren.avagyan Thanks for your feedback.

Our team will review your request and get back on Monday.

Hey @suren.avagyan

We’ll have a look at your PR, thanks a lot for submitting it. We can continue this discussion there itself. I’ve already referred this to one of our senior developers.

Thanks @yashovardhan . This is a blocker issue for us.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

thanks for the suggestion but, the major reason popup is blocked is because of the await before in getLoginId function.
This can’t be avoided unfortunately. Hence, this solution won’t be a fix 100%.
we recommend that you switch to using redirect mode instead.