Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Trezor Connect Electron integration #245

Closed
bestdude opened this issue Oct 26, 2018 · 13 comments
Closed

Trezor Connect Electron integration #245

bestdude opened this issue Oct 26, 2018 · 13 comments
Assignees

Comments

@bestdude
Copy link

I’m trying to integrate trezor connect v6 to my electron application, but it seems it is not compatible,
as popup\iframe window flow does not succeed. In one case popup cannot be created because of electron Window open differences. If I specify nativeWindowOpen for compatibility it doesn’t crash on the step of popup creation, but it just fails on the further steps.
Can you suggest what can be wrong or is it just not compatible? Are you aware
of any successful integrations into electron app?

@szymonlesisz
Copy link
Contributor

Hi @bestdude,
You did nothing wrong, trezor-connect isn't prepared to work in different environment than browser yet.
We are working on it.

@prusnak prusnak changed the title Trezor connect v6 electron integration Trezor Connect Electron integration Feb 4, 2019
@KevinBaiSg
Copy link

Thanks, @prusnak , When can I use it supported electron? Because I want to develop a demo application for my teams this month. I have to decide to use trezor.js or connect for the time being. Do you have a demo use trezor.js?

@prusnak
Copy link
Member

prusnak commented Mar 15, 2019

@szymonlesisz can you please describe what needs to done/fixed to use Connect in an Electron app?

@tayvano
Copy link

tayvano commented Mar 18, 2019

Over a year ago we took steps, including using a forked version of trezor.js for months, in order to get Trezor working with our MyCrypto Electron app. Now we're back to square 1 as, once again, Electron apps no way of communicating with Trezor devices.

The "Safety check failed" error is now our # 1 support ticket with our users. While I understand Trezor has a lot going on, our in production and highly used applications are now broken due to the recent upgrades and, even worse, we have no path forward to resolve this matter.

While I understand you view using trezor.js as an obsolete library, it's the only library that worked for electron applications + trezor.

What can we do to get this resolved?

@rodrigopavezi
Copy link

rodrigopavezi commented Mar 18, 2019

@tayvano we fixed for now the issue with this change. https://github.com/SelfKeyFoundation/trezor-wallet-provider/pull/6/files though we know it can break at anytime they change something on the firmware or trezor-link and won't update trezor.js. We will investigate if we can start using trezor-connect but I guess it will not be an easy thing. Cheers

@szymonlesisz
Copy link
Contributor

szymonlesisz commented Mar 20, 2019

Guys, good news. I've managed to run it inside electron. It could be used 100% offline (without serving connect from connect.trezor.io domain) with our UI/popup or without it (your own custom UI/modals)
Today i will prepare some boilerplate to show you what needs to be done.
However i want to do it right, so the boilerplate will be "early beta", just for tryout and tests.
We will release it after we test all cases (operating systems, builds, etc.)

Note that i'm not an expert in electron env, so i will appreciate your help and hints.

@rodrigopavezi
Copy link

@szymonlesisz thanks a lot. we can't wait for it. Anything you need please let me know. Cheers

@KevinBaiSg
Copy link

@szymonlesisz thanks, this is good news

@szymonlesisz
Copy link
Contributor

so here it is:
https://github.com/szymonlesisz/trezor-connect-electron-boilerplate

description in readme, try it and let me know is it working for you

@szymonlesisz
Copy link
Contributor

do you guys maybe know how to solve this issue with missing window.opener when connect is hosted outside? I've been struggling with this whole day. I've tried: https://gist.github.com/Gvozd/2cec0c8c510a707854e439fb15c561b0
but doesn't work. any ideas how to postMessage from popup@connect.trezor.io to electron when it doesn't have access to window.opener. should i use some ipc communication (not sure how)?

@tayvano
Copy link

tayvano commented Mar 22, 2019

@szymonlesisz We have only been able to implement a bandaid solution using trezor js for now

MyCryptoHQ/MyCrypto#2443

@szymonlesisz
Copy link
Contributor

This is a little bit outdated, but better late than never.

Electron examples:
https://github.com/trezor/connect/tree/develop/examples/electron

@tayvano
Copy link

tayvano commented May 5, 2020

💖

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

No branches or pull requests

6 participants