trezor / trezor-suite

Trezor Suite Monorepo
https://trezor.io/trezor-suite
Other
721 stars 251 forks source link

Cannot login via Firefox, which does not support the WebUSB api #6148

Open 0x70b1a5 opened 2 years ago

0x70b1a5 commented 2 years ago

Describe the bug Connect-web v9 does not work in Firefox because FF does not support the WebUSB api, via the experimental Feature-Policy: usb.

Info:

How to reproduce Steps to reproduce the behavior:

  1. Make a new app with npx create-react-app trezor-ff-bug; cd trezor-ff-bug
  2. Add the initialization code to App.js
  3. npm run start
  4. In Firefox browser at localhost:3000, open devtools with F12
  5. Observe the warning: Feature Policy: Skipping unsupported feature name “usb”. and note that any Trezor functionality (eg, a button that calls the login function) doesn't work.

Expected behavior I expected to be able to use trezor v9 in Firefox, which is a popular modern browser.

Adamj1232 commented 2 years ago

+1 Same problem here

sime commented 2 years ago

@0x70b1a5 Does login work for you with Trezor Bridge? Or running Trezor Suite in the background.

0x70b1a5 commented 2 years ago

@sime Unfortunately, it does not work with either method. With Suite in the background, attempting to connect via Firefox DOES actually open a new tab and set the Trezor to "In Use" in Suite, but it never connects to my app.

sime commented 2 years ago

@0x70b1a5 Not sure what you are experiencing now, you don't need to set the Trezor to 'in use' in the suite, you only need to have Trezor Suite running.

To confirm the bridge is running, visit http://127.0.0.1:21325/status/

Can you get interactions with your Trezor to work on this site? https://connect.trezor.io/9/#/method/getPublicKey

0x70b1a5 commented 2 years ago

@sime I wasn't manually setting Trezor to 'in use'; it was setting itself to 'in use' as soon as my local web app tried to authenticate with Trezor.

The bridge is running, yes.

In firefox, trezor works fine with connect.trezor.io, yes. Interesting! Is that website using the v9 API?

sime commented 2 years ago

In firefox, trezor works fine with connect.trezor.io, yes. Interesting! Is that website using the v9 API?

Yes, note the '9' in the URL https://connect.trezor.io/9/

0x70b1a5 commented 2 years ago

Alright, cool. However, for some reason I still can't authenticate with Firefox using trezor/connect-web from my local React app. Using Brave browser, it works fine.

sime commented 2 years ago

@0x70b1a5 Could be related to this issue: https://github.com/trezor/trezor-suite/issues/5644

Try disabling cookie protection.