wallet-adapter icon indicating copy to clipboard operation
wallet-adapter copied to clipboard

Explore whether mid-session wallet installation is detectable by focus-tracking the Window object

Open steveluscher opened this issue 2 years ago • 1 comments

Origin: https://github.com/solana-labs/wallet-adapter/pull/327#issuecomment-1052898918


We want to be able to detect when you've installed a new wallet in the middle of a session. Right now, we poll, every second, forever.

I have a hunch that when you're in the middle of a session, and you install a brand new wallet, the mere act of clicking on the installer UI causes the window to blur and focus. If this is so, we should be able to use the fact of that to detect that a wallet has been installed. Just listen for focus events on window and do another round of detection for the undetected wallets then!

This is an antidote to having to poll, forever. Polling keeps the process awake, but listening for focus lets it sleep.

steveluscher avatar Feb 27 '22 01:02 steveluscher

Closing here since polling isn't needed in https://github.com/wallet-standard/wallet-standard

jordaaash avatar Aug 17 '22 00:08 jordaaash