diff --git a/CHANGELOG.md b/CHANGELOG.md index ead069c24929..5d531ef4d9fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Rebrand "Profile syncing" to "Backup and sync", adding a dedicated settings menu and more ([#32129](https://github.com/MetaMask/metamask-extension/pull/32129)) - Show UI error to user if vault should exist, but is missing ([#31404](https://github.com/MetaMask/metamask-extension/pull/31404)) +- Add new security preference: `skipDeepLinkInterstitial` ([#33634](https://github.com/MetaMask/metamask-extension/pull/33634)) - Add RPC (sub)domain tracking to transaction event metrics for RPC endpoints usage ([#32076](https://github.com/MetaMask/metamask-extension/pull/32076)) - Integrate dynamic content banners ([#32101](https://github.com/MetaMask/metamask-extension/pull/32101)) - Add ability to update remote mode delegations and remove the now redundant "Update to a smart account" step on setup flows ([#32713](https://github.com/MetaMask/metamask-extension/pull/32713)) diff --git a/app/_locales/en/messages.json b/app/_locales/en/messages.json index c98667d97718..94f90c54e68d 100644 --- a/app/_locales/en/messages.json +++ b/app/_locales/en/messages.json @@ -5156,6 +5156,12 @@ "skipAccountSecuritySkip": { "message": "Skip" }, + "skipDeepLinkInterstitial": { + "message": "Don't show interstitial screen when opening deep links" + }, + "skipDeepLinkInterstitialDescription": { + "message": "Enabling this option will skip the interstitial screen that is shown when opening deep links in MetaMask. A \"deep link\" is a link like https://link.metamask.io/home that will cause MetaMask to open; these links can be obfuscated by others. The interstitial screen is designed to protect you from accidentally opening pages within MetaMask that might display your accounts, tokens, history, balances, settings, or other potentially sensitive information. This setting only applies to links signed by MetaMask." + }, "slideBridgeDescription": { "message": "Move across 9 chains, all within your wallet" }, diff --git a/app/_locales/en_GB/messages.json b/app/_locales/en_GB/messages.json index c98667d97718..94f90c54e68d 100644 --- a/app/_locales/en_GB/messages.json +++ b/app/_locales/en_GB/messages.json @@ -5156,6 +5156,12 @@ "skipAccountSecuritySkip": { "message": "Skip" }, + "skipDeepLinkInterstitial": { + "message": "Don't show interstitial screen when opening deep links" + }, + "skipDeepLinkInterstitialDescription": { + "message": "Enabling this option will skip the interstitial screen that is shown when opening deep links in MetaMask. A \"deep link\" is a link like https://link.metamask.io/home that will cause MetaMask to open; these links can be obfuscated by others. The interstitial screen is designed to protect you from accidentally opening pages within MetaMask that might display your accounts, tokens, history, balances, settings, or other potentially sensitive information. This setting only applies to links signed by MetaMask." + }, "slideBridgeDescription": { "message": "Move across 9 chains, all within your wallet" }, diff --git a/app/scripts/controllers/preferences-controller.test.ts b/app/scripts/controllers/preferences-controller.test.ts index e12492bcd460..7c17ee38cd67 100644 --- a/app/scripts/controllers/preferences-controller.test.ts +++ b/app/scripts/controllers/preferences-controller.test.ts @@ -669,6 +669,7 @@ describe('preferences controller', () => { useNativeCurrencyAsPrimaryCurrency: true, hideZeroBalanceTokens: false, petnamesEnabled: true, + skipDeepLinkInterstitial: false, dismissSmartAccountSuggestionEnabled: false, featureNotificationsEnabled: false, showConfirmationAdvancedDetails: false, @@ -697,6 +698,7 @@ describe('preferences controller', () => { useNativeCurrencyAsPrimaryCurrency: true, hideZeroBalanceTokens: false, petnamesEnabled: true, + skipDeepLinkInterstitial: false, privacyMode: false, dismissSmartAccountSuggestionEnabled: false, featureNotificationsEnabled: false, diff --git a/app/scripts/controllers/preferences-controller.ts b/app/scripts/controllers/preferences-controller.ts index a21d4b225f86..70c2a1f4f078 100644 --- a/app/scripts/controllers/preferences-controller.ts +++ b/app/scripts/controllers/preferences-controller.ts @@ -106,6 +106,7 @@ export type Preferences = { }; tokenNetworkFilter: Record; dismissSmartAccountSuggestionEnabled: boolean; + skipDeepLinkInterstitial: boolean; smartAccountOptIn: boolean; }; @@ -202,6 +203,7 @@ export const getDefaultPreferencesControllerState = sortCallback: 'stringNumeric', }, tokenNetworkFilter: {}, + skipDeepLinkInterstitial: false, }, // ENS decentralized website resolution ipfsGateway: IPFS_DEFAULT_GATEWAY_URL, diff --git a/test/e2e/fixture-builder.js b/test/e2e/fixture-builder.js index 8453edae790e..52d160231bd5 100644 --- a/test/e2e/fixture-builder.js +++ b/test/e2e/fixture-builder.js @@ -122,6 +122,7 @@ function onboardingFixture() { [ETHERSCAN_SUPPORTED_CHAIN_IDS.MEGAETH_TESTNET]: true, [ETHERSCAN_SUPPORTED_CHAIN_IDS.MONAD_TESTNET]: true, }, + skipDeepLinkInterstitial: false, }, SelectedNetworkController: { domains: {}, diff --git a/ui/helpers/constants/settings.js b/ui/helpers/constants/settings.js index 9c0a61180e67..06918169b54e 100644 --- a/ui/helpers/constants/settings.js +++ b/ui/helpers/constants/settings.js @@ -204,7 +204,7 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#reveal-secretrecovery`, icon: 'fa fa-lock', }, - // securityAndPrivacy settingsRefs[3] + // securityAndPrivacy settingsRefs[2] { tabMessage: (t) => t('securityAndPrivacy'), sectionMessage: (t) => t('usePhishingDetection'), @@ -212,6 +212,14 @@ const SETTINGS_CONSTANTS = [ route: `${SECURITY_ROUTE}#phishing-detection`, icon: 'fa fa-lock', }, + // securityAndPrivacy settingsRefs[3] + { + tabMessage: (t) => t('securityAndPrivacy'), + sectionMessage: (t) => t('skipDeepLinkInterstitial'), + descriptionMessage: (t) => t('skipDeepLinkInterstitialDescription'), + route: `${SECURITY_ROUTE}#skip-deep-link-interstitial`, + icon: 'fa fa-lock', + }, // securityAndPrivacy settingsRefs[4] { tabMessage: (t) => t('securityAndPrivacy'), diff --git a/ui/helpers/utils/settings-search.test.js b/ui/helpers/utils/settings-search.test.js index f1431e194c3a..6b965724ff45 100644 --- a/ui/helpers/utils/settings-search.test.js +++ b/ui/helpers/utils/settings-search.test.js @@ -183,7 +183,7 @@ describe('Settings Search Utils', () => { it('returns "Security & privacy" section count', () => { expect( getNumberOfSettingRoutesInTab(t, t('securityAndPrivacy')), - ).toStrictEqual(20); + ).toStrictEqual(21); }); it('returns "Network" section count', () => { diff --git a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap index 5665f491192a..c84ec5a554af 100644 --- a/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap +++ b/ui/pages/settings/security-tab/__snapshots__/security-tab.test.js.snap @@ -316,6 +316,82 @@ exports[`Security Tab should match snapshot 1`] = ` +
+