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

Add Trezor Support #1205

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

PabloCastellano
Copy link
Contributor

@PabloCastellano PabloCastellano commented Mar 20, 2022

Hello!

Based on the Ledger implementation I am here drafting the Trezor implementation.

This is not working because the trezor popup is closed. My trezor is connected but I don't get prompted to enter my PIN. Any ideas?

out-2.mp4

Test it

git remote add pablocastellano https://github.com/PabloCastellano/extension.git
git fetch pablocastellano
git checkout -b pablocastellano/trezor-support-final

Also add HIDE_IMPORT_TREZOR=false to your .env.

Open questions

  • Should we allow the popup from trezor somehow in manifest.json? (I have no previous experience with extensions development so I'm not sure if it makes sense)
  • Should we initialize TrezorConnect in TrezorService instead?
  • Where is the correct place to place <script src="https://connect.trezor.io/8/trezor-connect.js"></script>?

TODO

  • Trezor One working
  • Finish Trezor UI (now borrowing Ledger UI)

Logs

console logs:

trezor: manifest
DevTools failed to load source map: Could not load content for chrome-extension://aldgjcfonekifbpplgdgnblkoidoolid/provider-bridge.js.map: System error: net::ERR_BLOCKED_BY_CLIENT
provider-bridge.js:258  content: background > inpage: {"id":"tallyHo","result":{"method":"tally_getConfig","defaultWallet":true}}
DevTools failed to load source map: Could not load content for chrome-extension://aldgjcfonekifbpplgdgnblkoidoolid/window-provider.js.map: System error: net::ERR_BLOCKED_BY_CLIENT

@fernya
Copy link
Contributor

fernya commented Mar 21, 2022

Hey @PabloCastellano, my 2 cents are:

Should we allow the popup from trezor somehow in manifest.json? (I have no previous experience with extensions development so I'm not sure if it makes sense)

I think if that would be forbidden to show right now then you wouldn't have it on your video showing up intermittently.
It would be good to somehow block the closing event of that window and check the console and see if that has anything useful for us!

Should we initialize TrezorConnect in TrezorService instead?

That would be appropriate but first its good enough to see something during onboarding flow! :)

Where is the correct place to place <script src="https://connect.trezor.io/8/trezor-connect.js"></script>?

For testing purposes you might experiment with hardwiring it into ui/public/tab.html but I don't think that its the culprit right now!
Please check content_security_policy field in extension's manifest.json, it might be worth to check that does it require additional setting to enable the remotely added script?

@PabloCastellano
Copy link
Contributor Author

PabloCastellano commented Mar 25, 2022

@fernya I have tried blocking the closing event but I haven't got anything useful. Also did some changes in the manifest.json file but nothing relevant, probably because I don't have so much experience with extensions development.

Any advice is welcome!

@greg-nagy
Copy link
Contributor

@PabloCastellano I would love to see this land in the extension 💪

But at the moment we are pretty much in churn mode for release and trezor is not on the requirement list for v1.
Is it ok with you, if we circle back to this integration after v1 release?

I will gladly spend some time on debugging this issue :)
Not sure how the implementation works for trezor, but could it be loaded in an iframe?

@PabloCastellano
Copy link
Contributor Author

@greg-nagy Yeah sure, no problem! Trezor support can wait for v2 😉

@Shadowfiend
Copy link
Contributor

@PabloCastellano are you still interested in implementing Trezor support? Asking as we look to clean up stale PRs and figure out what's next.

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

Successfully merging this pull request may close these issues.

None yet

4 participants