MetaMask / MetaMask/metamask-extension
[P2] util.js: relocate browser + clipboard helpers
- Dominant language
- TypeScript
- Stars
- 13.2k
- Forks
- 5.6k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 451
Description
**Parent Epic:** [#44552 — `util.js` decomposition](https://github.com/MetaMask/metamask-extension/issues/44552)
**Source:** `ui/helpers/utils/util.js`
**Size:** S
---
## Problem
`getIsBrowserDeprecated` and `clearClipboard`. `getIsBrowserDeprecated` depends on the UI constant `OUTDATED_BROWSER_VERSIONS`, so a shared-side home would create a ui→constant back-reference.
## Solution
Place both in a small UI module `ui/helpers/utils/browser.ts` (alongside `is-mobile-view.js`) to keep the constant coupling UI-side; or `shared/lib/browser-runtime.utils.ts` if the constant is moved too. Rewire the 1–2 import sites.
## Acceptance Criteria
- [ ] Both helpers relocated; originals deleted; imports rewired; no ui→shared back-reference introduced. Tests green.
Contributor guide
Research direction
Start with ui/helpers/utils/util.js and trace the 1–2 import sites for getIsBrowserDeprecated and clearClipboard, then review the UI constant OUTDATED_BROWSER_VERSIONS and nearby ui/helpers/utils modules. Relocate both helpers to the agreed browser module, remove the originals, rewire imports without a ui→shared back-reference, and run the relevant tests until they are green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100