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

How to handle browsers that don't support popup read / postMessage #33

Open
tennox opened this issue Jun 18, 2021 · 1 comment
Open

Comments

@tennox
Copy link
Contributor

tennox commented Jun 18, 2021

As mentioned in #20 (comment)

During testing I encountered some browsers which apparently lack all or some of the following:

  • popup URL tracking (like you use)
  • window.opener being set to the opening window (to communicate back)
  • window.postMessage (docs)

Examples of this:

Firefox Focus/Klar does not allow communication between tabs (at least I didn't get it to work)

MetaMask android (and many apps with in-app browser) (opens popup in separate browser app and thus allows no communication)

So I'm trying to figure out how to support those cases / provide a fallback.

Possible strategies:

Call server function in popup

Popup calls server & closes itself -> original window checks server for completion
This would work in any situation, even when the popup is opening a separate

Disadvantage: added complexity in backend is needed

Fallback to redirect flow

A redirect flow would work in all browsers as it stays in same window and just redirects back to the app.

Disadvantage: Needs app to know how to restore app state.
Problem: I don't see a way to detect whether to use this fallback reliably, and defaulting to it degrades UX for all other users.

@bhubr
Copy link
Owner

bhubr commented Jun 18, 2021

Thanks for pointing this out again, and providing more context and details!

Since I've just starting working on the project again after a long hiatus, I'll try to use the momentum to keep on improving it... I'll look into it next Monday (too much eye strain for now 😧).

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

2 participants