Skip to content

Improve Ledger device detection and MV3 compatibility#3821

Open
hyphenized wants to merge 3 commits intomainfrom
usb-event-handlers-1
Open

Improve Ledger device detection and MV3 compatibility#3821
hyphenized wants to merge 3 commits intomainfrom
usb-event-handlers-1

Conversation

@hyphenized
Copy link
Copy Markdown
Contributor

@hyphenized hyphenized commented Aug 29, 2025

Prevents pairing failures by replacing the hardcoded productId list with vendorId based querying. This automatically supports new Ledger devices and firmware updates that can change internal productIds.

Added a helper function to verify the Ledger has the Ethereum app open before fully commiting to the connection flow. Within the service, supported device checks where removed as the underlying transport library already handles device compatibility filtering.

This PR also fixes compatibility issues related to event handlers with Manifest V3. Preventing race conditions where USB connect/disconnect events could be missed if handlers weren't registered in time.

These where related to the following warnings:
image

Notes:

If Chrome forgets the USB device pairing, Users will need to reconnect via the tabbed onboarding flow. This is a browser limitation since USB device pairing can only be requested from certain contexts, not from the extension popup or background processes.

Testing:

Tested with Nano S, Nano X, Nano S Plus. Connectivity issue found with NanoS after software update.

  • Should be tested with various Ledger models
  • Verify behavior when Ethereum app is not open
  • Test USB connect/disconnect events

Latest build: extension-builds-3821 (as of Fri, 29 Aug 2025 01:43:02 GMT).

This queries Ledger devices by vendorId instead of using a hardcoded
list of known productId/vendorId matches. This is the same approach used
by the underlying transport library and prevents cases where the Ledger
does not show up in the list of devices to pair due to the productId being
changed by a recent ledger app update.

`TestedProductId` assertion was removed as TransportWebUSB already
filters compatible devices.
@hyphenized hyphenized changed the base branch from main to testing-tests-e2e-fork December 14, 2025 10:06
@hyphenized hyphenized changed the title Setup a proxy for USB connect/disconnect events handlers Improve Ledger device detection and MV3 compatibility Dec 14, 2025
@hyphenized hyphenized marked this pull request as ready for review December 14, 2025 16:21
@hyphenized hyphenized self-assigned this Dec 14, 2025
Base automatically changed from testing-tests-e2e-fork to main January 10, 2026 15:57
@Shadowfiend
Copy link
Copy Markdown
Contributor

Matt gave this a shot and didn't see a significant improvement unf. Nonetheless I think it's a good change so expect to land shortly.

@hyphenized
Copy link
Copy Markdown
Contributor Author

Matt gave this a shot and didn't see a significant improvement unf. Nonetheless I think it's a good change so expect to land shortly.

He still has issues with his ledger? Hmmmm I wonder if there's something specific to his webusb device connection or if there are any notable errors popping in the worker during connection/sign

@Shadowfiend
Copy link
Copy Markdown
Contributor

Yah will see if we can get some more/better logs meantime.

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.

2 participants