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

Store initiator origin info for DAPP requests #21915

Closed
yrliou opened this issue Mar 27, 2022 · 3 comments · Fixed by brave/brave-core#12987
Closed

Store initiator origin info for DAPP requests #21915

yrliou opened this issue Mar 27, 2022 · 3 comments · Fixed by brave/brave-core#12987

Comments

@yrliou
Copy link
Member

yrliou commented Mar 27, 2022

We need to store initiator's origin for dapp requests that would prompt UI for user to confirm.

See BraveWalletJSHandler::SendAsync, BraveWalletJSHandler::Send, BraveWalletJSHandler::Request for entry points.
See BraveWalletProviderImpl::CommonRequestOrSendAsync for how backend start to process different methods.

Besides sendEthTransaction requests that would be get from pending transactions. UI get those pending requests in /~https://github.com/brave/brave-core/blob/master/components/brave_wallet_ui/panel/async/wallet_panel_async_handler.ts#L171-L194. We need to provide initiator's origin for all these DAPP requests to UI.

/~https://github.com/bbondy/eth-manual-tests and https://metamask.github.io/test-dapp/ might be useful for testing.

For QA:

  1. Go to https://metamask.github.io/test-dapp/
  2. Click connect and setup with one of wallet accounts
  3. On this site scroll to "Ethereum Chain Interactions", click "Add xDAI Chain" button. This wallet bubble appears
    image
    Close bubble by clicking outside of it.
  4. Open some other tab and click Wallet button
  5. Same bubble appears. It should have metamask url and icon on top of it:
    Bad:
    image
    Good:
    image
@yrliou yrliou added feature/web3/wallet Integrating Ethereum+ wallet support OS/Android Fixes related to Android browser functionality OS/Desktop feature/web3/wallet/dapps feature/web3/wallet/core labels Mar 27, 2022
@yrliou yrliou added this to Web3 Mar 27, 2022
@yrliou yrliou moved this to In Progress in Web3 Mar 29, 2022
@yrliou
Copy link
Member Author

yrliou commented Apr 1, 2022

eTLD+1 is also needed to be stored, see brave/brave-core#12701.

@diracdeltas
Copy link
Member

does this also need to be done for iOS/android? i noticed brave/brave-ios#5218

@srirambv
Copy link
Contributor

Brave 1.39.96 Chromium: 101.0.4951.54 (Official Build) beta (64-bit)
Revision 67da1aeb32cedd27634ca6634fb79cbd85d3f0ab-refs/branch-heads/4951@{#1126}
OS ☑️ Linux ☑️ Windows 11 Version Dev
(Build 22616.1)
☑️ macOS Version 12.0.1
(Build 21C52)
  • Verified steps from issue
Same domain
Different domain

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants