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

Sui Wallet :: externally_connectable extension support #20753

Open
zanuka opened this issue Dec 31, 2024 · 4 comments
Open

Sui Wallet :: externally_connectable extension support #20753

zanuka opened this issue Dec 31, 2024 · 4 comments
Assignees
Labels
doc-issue Issue submitted using the Doc issue template sui-wallet

Comments

@zanuka
Copy link

zanuka commented Dec 31, 2024

New

I'm working on a new browser extension and would like users to be able to login to their Sui wallet from the extension popup and not have to call ConnectButton from a standard browser window.

I've tried multiple configs of my V3 extension manifest, using 'externally_connectable' like so:

  "externally_connectable": {
    "matches": [
      "https://*.sui.io/*",
      "https://*.suinet.app/*",
      "https://wallet-provider.sui.io/*",
      "chrome-extension://opcgpfmipidbgpenhmajoajpbobppdil/*"
    ]
  },

Using various configs, I can't get it to connect to the Sui Wallet extension, and am instead seeing the 'Get Started with Sui' heading and text prompting user to install the Sui extension, after clicking the 'Sui Wallet' button that appears on step 2 of the 'Connect Wallet' flow. ( screenshots attached for context )

I think that it will only work if your Sui Wallet extension exposes that particular API option publicly, using "*" wildcard in the matches[] array, as stated in Google extensions docs here - https://developer.chrome.com/docs/extensions/reference/manifest/externally-connectable

For more info on how my browser extension will be leveraging both Sui and Walrus, feel free to check out the official public repo here - https://github.com/zanuka/leaderport-core-ui - where I have a detailed readme and docs on the overall vision / plan.

It's open-source and will be free to download, featuring both on- and off-chain functionality. So it would be awesome to be able to have Sui Wallet as my first supported Web3 wallet.

Perhaps there will be other browser extensions that might also want to be able to connect this way as well and your team would find this extension-to-extension communication to be useful. 🤞🏼

Popup - Step 1
leaderport-sui-login-A

Popup - Step 2
leaderport-sui-login-B

Popup - Step 3
leaderport-sui-login-C

Thanks for your time!

@zanuka zanuka added the doc-issue Issue submitted using the Doc issue template label Dec 31, 2024
@zanuka
Copy link
Author

zanuka commented Jan 3, 2025

@hayes-mysten I had meant to include this link as well, which has the info on cross-extension messaging: https://developer.chrome.com/docs/extensions/develop/concepts/messaging#external

Also not sure how I added the 'doc-issue' label when creating the issue, or perhaps that was automatic. Mike

@hayes-mysten
Copy link
Contributor

I've passed this issue along to the wallet team.

I think directly sending messages to the extension is not something they are planning to support. I think the correct way for this to work would be to allow the wallet inject its content script into any webviews that need to connect to the wallet. Unfortunately, I don't know a lot about chrome extensions myself, and am not sure if/how that could be enabled.

Another option might be to support the stashed wallet instead, since it doesn't require interacting with a browser extension

@zanuka
Copy link
Author

zanuka commented Jan 7, 2025

Thanks @hayes-mysten, much appreciated. I've pivoted my project concept a bit in the meantime and am just focusing on supporting Sui Wallet login via a base 'intermediary' page which works as expected. The more I thought about it, the more the extension-to-extension communication seemed like a feature that users would not enjoy.

@hayes-mysten
Copy link
Contributor

Yeah, that makes sense to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-issue Issue submitted using the Doc issue template sui-wallet
Projects
None yet
Development

No branches or pull requests

4 participants