MetaMask / MetaMask/metamask-mobile

Metasmask user-agent

Open
#3,920 2 comments 2 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3k
Forks
1.7k
Avg merge
1d 14h
Merged PRs (30d)
669

Description

What's the recommend way to detect the user is using the Metamask built-in browser ?

I think user-agent is a good way. probably cannonical way

`export const isMetamaskBrowser = /(Metamask)/i.test(navigator.userAgent)`

However looking at the source the it appears you are not currently adding a custom identifier to the user-agent string

https://github.com/MetaMask/metamask-mobile/blob/bcc22b37381fe59200fc560c42c4712b89106309/app/core/AppConstants.js#L35

Contributor guide

Open the contributing guide

Research direction

Start with app/core/AppConstants.js at line 35 and review the referenced user-agent definition. Check how the built-in browser exposes its user agent and whether the proposed identifier can be verified consistently. Done means the browser can be detected through the documented user-agent behavior, with tests or verification covering the resulting string.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react-native
Domain
mobile, web-dev
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.