feat: add privacy settings deeplink - #45504
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
|
feat/add-privacy-settings-deeplink |
Builds ready [4725f52]
⚡ Performance Benchmarks (Total: 🟢 11 pass · 🟡 9 warn · 🔴 4 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7697737. Configure here.
Builds ready [7697737]
⚡ Performance Benchmarks (Total: 🟢 11 pass · 🟡 10 warn · 🔴 3 fail)
Bundle size diffs
|
7697737 to
7866bcd
Compare
Builds ready [cb7f2ee]
⚡ Performance Benchmarks (Total: 🟢 8 pass · 🟡 12 warn · 🔴 4 fail)
Bundle size diffs
|
✨ Files requiring CODEOWNER review ✨👨🔧 @MetaMask/core-extension-ux (2 files, +46 -23)
|
Builds ready [b6f9fd6]
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 7 warn · 🔴 2 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [fae6dfd] [reused from b6f9fd6]
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 7 warn · 🔴 2 fail)
Bundle size diffs [🚀 Bundle size reduced!]
|
Builds ready [6e19e87]
⚡ Performance Benchmarks (Total: 🟢 14 pass · 🟡 7 warn · 🔴 3 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Builds ready [d696a93]
⚡ Performance Benchmarks (Total: 🟢 13 pass · 🟡 8 warn · 🔴 3 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
|
Builds ready [06cdea4]
⚡ Performance Benchmarks (Total: 🟢 15 pass · 🟡 6 warn · 🔴 3 fail)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
ameliejyc
left a comment
There was a problem hiding this comment.
Approving for core extension ux files




Description
We need a shareable URL (distributed e.g. via a Branch link on
link.metamask.io) that lets existing users review or revoke their analytics consent — the "Participate in MetaMetrics" and "Data collection for marketing" toggles. Today there is no deep link that lands on the Privacy & Security settings, so users have to find the toggles manually.This PR adds a new public deep-link route,
https://link.metamask.io/privacy, that resolves to Settings → Privacy & Security, scrolled to the requested toggle:shared/lib/deep-links/routes/privacy.tswith an optionalsettingquery param:setting=metametrics(default, and fallback for unknown values) → scrolls to the "Participate in MetaMetrics" togglesetting=data-collection→ scrolls to the "Data collection for marketing" toggle/settings/privacy#<anchor>; the settings page already scrolls to the item whose id matches the URL hash (ui/pages/settings/shared/settings-tab.tsx, the same mechanism used by settings search and by in-app links such as#autodetect-tokens), so the settings UI is unchanged.deepLink_thePrivacySettingsPagelocale message used by the deep-link interstitial ("You're about to visit the privacy settings page").RequireAuthenticatedstores the full intended location inlocation.state.from, but the post-unlock redirect inunlock-page.container.ts/unlock-page.component.tsxrebuilt onlypathname + search, so the scroll target was lost. Both now appendfrom.hash. This is the first deep link to use a hash target, which is why the gap surfaced here; the existing in-app hash links never hit the unlock screen.fromlocation, not from a user-supplied redirect param (sanitizeRedirectUrlstill strips fragments as before).Counterpart mobile PR (same
privacyaction andsettingparam): MetaMask/metamask-mobile#34770Changelog
CHANGELOG entry: Added a deep link (https://link.metamask.io/privacy) that opens the Privacy & Security settings scrolled to the MetaMetrics or marketing data collection toggle, and fixed the scroll target being lost when the wallet had to be unlocked first
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/GE-416
Refs: MetaMask/metamask-mobile#34770 (mobile counterpart)
Manual testing steps
Unlocked wallet
https://link.metamask.io/privacyinto the browser address barhttps://link.metamask.io/privacy?setting=data-collectionand verify it scrolls to the "Data collection for marketing" togglehttps://link.metamask.io/privacy?setting=not-a-real-valueand verify it falls back to the MetaMetrics toggleLocked wallet (covers the hash-after-unlock fix)
https://link.metamask.io/privacy?setting=data-collectioninto the browser address bar and click Continue on the interstitialScreenshots/Recordings
Before
N/A —
https://link.metamask.io/privacywas an unregistered deep link, so it showed the deep-link 404 error page.After
The link shows the standard deep-link interstitial and then lands on Privacy & Security settings scrolled to the selected toggle, whether or not the wallet had to be unlocked first (no visual changes to the settings page itself; recording can be added if reviewers want it).
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Navigation and deep-link routing only; no auth or consent logic changes. Hash comes from stored router state, not user-supplied redirect params.
Overview
Adds a public
/privacydeep link (link.metamask.io/privacy) that routes to Privacy & Security settings with a URL hash scroll target. Optionalsettingquery param maps tometametrics(default) ordata-collection; unknown values safely fall back to MetaMetrics via aSetallowlist (including inherited prototype keys).Post-unlock redirect now uses
getRedirectAfterUnlocksofrom.hashis kept—deep links that require unlock land on the correct toggle instead of the top of the page.Locale strings for the deep-link interstitial and tests cover the route handler, redirect helper, privacy anchor sync with settings item ids, and unlock redirect with hash.
Reviewed by Cursor Bugbot for commit 6e19e87. Bugbot is set up for automated code reviews on this repo. Configure here.