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

fix: 25457 firefox extension not work for trezor connect #25487

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion ui/pages/create-account/connect-hardware/select-hardware.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,16 @@ export default class SelectHardware extends Component {

connect = async () => {
if (this.state.selectedDevice) {
if (this.state.selectedDevice === 'trezor') {
// Not all browsers have usb support. In particular, Firefox does
// not support usb. More information on that can be found here:
// https://mozilla.github.io/standards-positions/#webusb
//
// The below `&& window.navigator.usb` condition ensures that we
// only attempt to connect Trezor via usb if we are in a browser
// that supports usb. If not, the connection of the hardware wallet
// to the browser will be handled by the Trezor connect screen. In
// the case of Firefox, this will depend on the Trezor bridge software
if (this.state.selectedDevice === 'trezor' && window.navigator.usb) {
davidmurdoch marked this conversation as resolved.
Show resolved Hide resolved
this.setState({ trezorRequestDevicePending: true });
try {
await window.navigator.usb.requestDevice({
Expand Down