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

Move window.ethereum to use gin #19909

Closed
bbondy opened this issue Dec 3, 2021 · 4 comments · Fixed by brave/brave-core#15498
Closed

Move window.ethereum to use gin #19909

bbondy opened this issue Dec 3, 2021 · 4 comments · Fixed by brave/brave-core#15498

Comments

@bbondy
Copy link
Member

bbondy commented Dec 3, 2021

@bridiver noted we should use gin for window.ethereum like we did for muon.

As an example:
NetErrorPageController
anything that includes object_template_builder.h


return gin::Wrappable<NetErrorPageController>::GetObjectTemplateBuilder(
             isolate)
      .SetMethod("downloadButtonClick",
                 &NetErrorPageController::DownloadButtonClick)
      .SetMethod("reloadButtonClick",
                 &NetErrorPageController::ReloadButtonClick)
      .SetMethod("detailsButtonClick",
                 &NetErrorPageController::DetailsButtonClick)
      .SetMethod("diagnoseErrorsButtonClick",
                 &NetErrorPageController::DiagnoseErrorsButtonClick)
      .SetMethod("trackEasterEgg", &NetErrorPageController::TrackEasterEgg)
      .SetMethod("updateEasterEggHighScore",
                 &NetErrorPageController::UpdateEasterEggHighScore)
      .SetMethod("resetEasterEggHighScore",
                 &NetErrorPageController::ResetEasterEggHighScore)
      .SetMethod("launchOfflineItem",
                 &NetErrorPageController::LaunchOfflineItem)
      .SetMethod("launchDownloadsPage",
                 &NetErrorPageController::LaunchDownloadsPage)
      .SetMethod("savePageForLater", &NetErrorPageController::SavePageForLater)
      .SetMethod("cancelSavePage", &NetErrorPageController::CancelSavePage)
      .SetMethod("listVisibilityChanged",
                 &NetErrorPageController::ListVisibilityChanged);
@bbondy bbondy added priority/P3 The next thing for us to work on. It'll ride the trains. feature/web3/wallet Integrating Ethereum+ wallet support OS/Android Fixes related to Android browser functionality OS/Desktop labels Dec 3, 2021
@bbondy bbondy added this to Web3 Mar 18, 2022
@bbondy bbondy moved this to Backlog in Web3 Mar 18, 2022
@darkdh
Copy link
Member

darkdh commented Jul 14, 2022

gin::Wrappable will also guarantee non function properties are read only

@darkdh
Copy link
Member

darkdh commented Aug 5, 2022

Task for window.ethereum.['_metamask', 'chainId', 'networkVersion', 'selectedAddress'] non writable protection will be merged into this issue

@srirambv
Copy link
Contributor

srirambv commented Jan 4, 2023

Verification passed on

Brave 1.47.161 Chromium: 109.0.5414.61 (Official Build) beta (64-bit)
Revision 846c6eff1c374cde417a9cdc44193545cc07f354-refs/branch-heads/5414@{#1030}
OS Linux
  • Verified steps from brave/brave-core#15498
  • Verified Ethereum Dapp options from https://github.com/bbondy/eth-manual-tests
  • Verified able to connect to an Ethereum Dapp
  • Verified after connecting to an Ethereum Dapp the connected state is saved in brave://settings/content/ethereum
  • Verified able to connect multiple accounts to Dapp
  • Verified able to Sign Transactions from an Ethereum account

Verification passed on

Brave 1.47.161 Chromium: 109.0.5414.61 (Official Build) beta (64-bit)
Revision 846c6eff1c374cde417a9cdc44193545cc07f354-refs/branch-heads/5414@{#1030}
OS Windows 11 Version 22H2 (Build 22621.755)
  • Verified steps from brave/brave-core#15498
  • Verified Ethereum Dapp options from https://github.com/bbondy/eth-manual-tests
  • Verified able to connect to an Ethereum Dapp
  • Verified after connecting to an Ethereum Dapp the connected state is saved in brave://settings/content/ethereum
  • Verified able to connect multiple accounts to Dapp
  • Verified able to Sign Transactions from an Ethereum account

Verification passed on

Brave 1.47.161 Chromium: 109.0.5414.61 (Official Build) beta (arm64)
Revision 846c6eff1c374cde417a9cdc44193545cc07f354-refs/branch-heads/5414@{#1030}
OS macOS Version 13.0 (Build 22A380)
  • Verified steps from brave/brave-core#15498
  • Verified Ethereum Dapp options from https://github.com/bbondy/eth-manual-tests
  • Verified able to connect to an Ethereum Dapp
  • Verified after connecting to an Ethereum Dapp the connected state is saved in brave://settings/content/ethereum
  • Verified able to connect multiple accounts to Dapp
  • Verified able to Sign Transactions from an Ethereum account

@srirambv
Copy link
Contributor

Verification passed on Oppo Reno 5 with Android 12 running 1.47.167 x64 build

  • Verified steps from brave/brave-core#15498
  • Verified Ethereum Dapp options from https://github.com/bbondy/eth-manual-tests
  • Verified able to connect to an Ethereum Dapp
  • Verified after connecting to an Ethereum Dapp the connected state is saved in Settings -> Site Settings -> Ethereum
  • Verified able to connect multiple accounts to Dapp
  • Verified able to Sign Transactions/Messages from an Ethereum account

Verification passed on Lenovo Tab with Android 12 running 1.47.167 x64 build

  • Verified steps from brave/brave-core#15498
  • Verified Ethereum Dapp options from https://github.com/bbondy/eth-manual-tests
  • Verified able to connect to an Ethereum Dapp
  • Verified after connecting to an Ethereum Dapp the connected state is saved in Settings -> Site Settings -> Ethereum
  • Verified able to connect multiple accounts to Dapp
  • Verified able to Sign Transactions/Messages from an Ethereum account

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