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

Communicate when FCL_POP is blocked from opening #1637

Closed
austinsamsel opened this issue Apr 28, 2023 · 2 comments
Closed

Communicate when FCL_POP is blocked from opening #1637

austinsamsel opened this issue Apr 28, 2023 · 2 comments
Assignees
Labels
Feature Seen 👀 This Issue has been seen by the Flow-JS-SDK Maintainers and they are thinking about it.

Comments

@austinsamsel
Copy link

austinsamsel commented Apr 28, 2023

Issue to be solved

we don't have good visibility in our apps when the dapper wallet pop up is blocked by the browser (let alone a way to seamlessly recover). although, we can sorta loosely infer it from some downstream errors we collect.

seems trivial to know when a pop up is blocked -- but, generally, we don't have a reference to the dapper wallet pop up in our apps. by default its only FCL that can "know" if a pop up was successfully opened or blocked by the browser.

// for example
  openPopUpWithCheck = () => {
    const newWindow = window.open('https://example.com', '_blank');

    if (!newWindow) {
      alert('Pop-up blocked by the browser.');
    }
  };

is this something FCL could/should provide some visibility on?


otherwise - i can do a workaround in our apps.

for context, in a couple places we've manually opened a pop up called "FCL_POP"

  • then when we have the transactions arguments ready,
  • we kick off the transaction,
  • and then fcl takes over the pop up we previously opened

this would give us a reference to the pop up, so we can know if it was successfully opened or blocked by the browser -- just probably not solving the problem in the right place (consumer vs library)

Suggest A Solution

suggestion:

  • Throw a specific error type/code whenever this happens. We could pick this up and handle it.

What are you currently working on that this is blocking?

This affects all workflows in which we use Dapper wallet - or any wallet that relies on pop up functionality.

@JeffreyDoyle JeffreyDoyle self-assigned this Apr 28, 2023
@JeffreyDoyle JeffreyDoyle added the Seen 👀 This Issue has been seen by the Flow-JS-SDK Maintainers and they are thinking about it. label Apr 28, 2023
@JeffreyDoyle
Copy link
Member

Hey @austinsamsel thank you for raising this issue! We're going to take a look at possible solutions and post and update here when we have a follow-up or an implementation.

@austinsamsel
Copy link
Author

alright... i see this in the code:

throw new Error("Popup failed to open (was it blocked by a popup blocker?)")

i'm gonna close this out, since it looks like you already support it.

will test it out on my side and can re-open if necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Seen 👀 This Issue has been seen by the Flow-JS-SDK Maintainers and they are thinking about it.
Projects
None yet
Development

No branches or pull requests

2 participants