MetaMask detect connection does not detect my mobile MetaMask App
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 25/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- javascript
调研方向
从 detectEthereumProvider 入口点开始,在桌面版和移动版 MetaMask 中复现所提供的 JavaScript 流程,包括 window.ethereum 和 ethereum#initialized 事件。比较每个平台返回的 provider,并确定是否支持移动端检测,或是否需要进行文档化的更改;当行为和下一步行动确定后即视为完成。
由索引模型根据 Issue 内容生成。
描述
const detectProv = async () => {
const provider = await detectEthereumProvider()
let web3 = new Web3(provider)
let chainID = await web3.eth.getChainId()
window.alert(chainID)
if (window.ethereum) {
handleEthereum();
} else {
window.addEventListener('ethereum#initialized', handleEthereum, {
once: true,
});
// If the event is not dispatched by the end of the timeout,
// the user probably doesn't have MetaMask installed.
setTimeout(handleEthereum, 3000); // 3 seconds
}
function handleEthereum() {
const { ethereum } = window;
if (ethereum && ethereum.isMetaMask) {
console.log('Ethereum successfully detected!');
window.alert("detected")
// Access the decentralized web!
} else {
console.log('Please install MetaMask!');
}
}
}
I try to detect my MetaMask application as the provider via a web-site using detect-provider library. In the desktop, it works fine but when I try to detect the provider using the same website and connect it to via my phone, it does not detect any provider. Where am I wrong?
- 主要语言
- JavaScript
- 星标
- 238
- 派生
- 63
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
MetaMask/detect-provider 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 20/100
MetaMask/detect-provider#122 ·
-
team-wallet-framework
难度 3/5 1-2 天 新手友好度 38/100
MetaMask/detect-provider#109 ·
-
team-wallet-framework
难度 3/5 1-2 天 新手友好度 35/100
MetaMask/detect-provider#108 ·
-
team-wallet-framework
难度 2/5 1-3 小时 新手友好度 55/100
MetaMask/detect-provider#107 ·
-
team-wallet-framework
难度 3/5 1-2 天 新手友好度 45/100
MetaMask/detect-provider#106 ·
查看 MetaMask/detect-provider 的全部 Issue
相似的 Issue
-
bug confirmed issue
难度 2/5 半天 新手友好度 78/100
open-webui/open-webui#35213 · 2 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
exa-studio/ApiVault#338 ·
-
难度 2/5 1-3 小时 新手友好度 84/100
Fei2411/DeepSeek-Bot#2556 ·
-
难度 1/5 1 小时以内 新手友好度 85/100
cline/mcp-marketplace#4235 ·
-
bug good first issue help wanted
难度 2/5 1-3 小时 新手友好度 90/100
vishwagw/Sky-Sim-drone-simulator-3.0#52 ·
维护者通常 1 天内回复