unisat-wallet / extension

The first open-source browser extension wallet for Bitcoin NFTs
Other
871 stars 336 forks source link

Regarding the popup wallet extension to connect wallet #225

Open Ce1ling opened 1 month ago

Ce1ling commented 1 month ago

When the website is not connected to the wallet, calling some methods will automatically pop up the wallet extension's connected wallet. such as getVersion, getBalance, getPublicKey etc.

Is this behavior supposed to happen?

I saw this paragraph in the official documentation: "You should only initiate a connection request in response to direct user action, such as clicking a button. You should always disable the "connect" button while the connection request is pending. You should never initiate a connection request on page load."

I very much agree with this statement, but the API doesn't seem to do this well. this will cause developers to have greater troubles.

Can you explain the reason, please?

Thanks for your reply.

Ce1ling commented 1 month ago

I think we should only pop the wallet connection via requestAccounts.