MetaMask / MetaMask/detect-provider

Unnecessary wait on desktop when not metamask installed

Open
#34 1 comment 2 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
238
Forks
63
PR merge metrics
No merged PRs in 30d

Description

Hello, I'm wondering - if I understand this correctly, if there is a `window.ethereum` object on desktop, it's available synchronously on website load. But still, when you dont have metamask installed on the desktop, it still waits for the set timeout (3s by default). But this wait is not necessary in this situation on desktop, is it? Is it necessary on mobile, when the `window.ethereum` is injected asynchronously and it can take some time, right?

Have you considered adding there another check after first check on `window.ethereum` to check, if I am on desktop and if I was and initial `window.ethereum` check would return false, the `detectEthereumProvider` would resolve with null immediately? I can try submit a PR, if this makes sense and I understand this correctly. Thanks!:)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the detectEthereumProvider entry point and reproduce the 3-second wait on desktop without MetaMask. Compare that behavior with asynchronous provider injection on mobile. Done means the desktop case resolves immediately when no provider exists while the mobile detection behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.