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

Firefox issues #14

Open
morgansson opened this issue Feb 3, 2021 · 11 comments
Open

Firefox issues #14

morgansson opened this issue Feb 3, 2021 · 11 comments

Comments

@morgansson
Copy link

The adapter on Firefox has a couple of usability issues that I've found so far.

  1. Whenever you connect the wallet, or approve a transaction, a new empty tab is opened on the dApp window.

  2. If you send an approval request from the dApp the wallet popup doesn't focus so you don't realize you need to perform an action on this popup as it's hidden behind the main window.

The steps to reproduce these issues are pretty simple, but if you have any question please let me know.

@AC-devon
Copy link

AC-devon commented Feb 24, 2021

i have issue #2 on chrome as well...

@PaulBernier
Copy link
Contributor

Same here. #2 especially kills the UX because the end-user (and myself 😁) won't understand why "nothing is happening".
I do see the lib is trying to focus the pop up: https://github.com/project-serum/sol-wallet-adapter/blob/master/src/index.js#L120 but somehow it's not effective.

@Arrowana
Copy link
Contributor

Arrowana commented Mar 4, 2021

I don't have number 2 on chrome, I tried with the example. popup comes in focus just fine. Are you connecting the wallet through a click event? That might be something chrome is blocking if the popup wasn't created by the user somehow.

Edit: popup comes in focus fine, when signing is requested.

@PaulBernier
Copy link
Contributor

For me it happens when I try to sign a transaction immediately after connecting, without a user interaction in between, something like:

        const publicKey = await wallet.connect();
        const trans = new Transaction().add(...);
        const signed = await wallet.signTransaction(trans);

@Arrowana
Copy link
Contributor

Arrowana commented Mar 5, 2021

@PaulBernier when .connect() resolves, the focus goes back to the dapp.
Maybe it tries to bounce between the dapp and back to the popup too fast? What if you insert a delay? Does it suddenly works?

sollet returns focus to parent through window.open('', 'parent');
https://github.com/project-serum/spl-token-wallet/blob/c8527e4fe30af3259f36d6838add668f474a413f/src/pages/PopupPage.js#L104
But this is done after we have called postMessage to tell the dapp we are connected. So it proceed to signTransaction.
I suspect popup.focus() is called, then immediately after window.open('', 'parent'). It ends up looking like it never changed focus.

maybe the fix is to give back the focus to the parent before we postMessage to it to confirm we are connected.

@PaulBernier
Copy link
Contributor

I tried with a delay but it doesn't work. It seems it really needs the user to focus the parent window by a click for the pop up to come forward afterward. It could definitely be related to the way the pop up gives back focus to the main window as you mention.

@PaulBernier
Copy link
Contributor

I am still stuck on this issue of the immediate second RPC call not bringing up the background popup (I tried a few hacks on the adapter side but none worked). What do you think of adding an extra parameter focus_back to the RPC call to Sollet that would control if Sollet should give back focus or not at the end of the operation? I am keen to make the modification on the Sollet side. @Arrowana @armaniferrante

@Arrowana
Copy link
Contributor

Don't we just need to reorder the calls? I might give it a go tonight.

@Arrowana
Copy link
Contributor

Arrowana commented Mar 30, 2021

Mmmh i just gave it a go,
used sollet localhost with focusParent() a setTimeout of 1000ms then in its callback postMessage on connect.
That doesn't fix it, https://stackoverflow.com/questions/24830249/javascript-pop-up-window-focus-issue it seems like we need user interaction to return the focus, so calling things in a chain like that, is not really doable.

@Arrowana
Copy link
Contributor

The adapter on Firefox has a couple of usability issues that I've found so far.

1. Whenever you connect the wallet, or approve a transaction, a new empty tab is opened on the dApp window.

2. If you send an approval request from the dApp the wallet popup doesn't focus so you don't realize you need to perform an action on this popup as it's hidden behind the main window.

The steps to reproduce these issues are pretty simple, but if you have any question please let me know.

I am still affected by 1. on firefox, that is quite annoying. I'll have another look soon.

@billythedummy
Copy link

Any updates on this? This issue still seems to affect firefox

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

5 participants