Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Don't show third party notice for preinstalled Snaps #27351

Closed
wants to merge 112 commits into from

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Sep 24, 2024

This cherry-picks commit 5cc14af into release 12.4.0.

Open in GitHub Codespaces

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

jiexi and others added 30 commits August 15, 2024 17:39
…Form update in-place rather than remove and add for rpcUrl changes (#26453)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Currently it is not possible to change the rpcUrl for an existing
network configuration without first removing it then re-adding it. This
poses an issue on extension when the rpcUrl for the currently selected
network is changed via the `NetworkForm`. The NetworkForm first removes
the existing networkClient which causes the SelectedNetworkController to
replace any references to the networkClientId being removed with the
selectedNetworkClientId, but the problem is that the
selectedNetworkClientId is no longer valid at that point and leaves the
SelectedNetworkController in a corrupted state.

Really what we want in this case is to allow the network configuration
to be updated in place by id, but only if the rpcUrl isn't changing to
one that already exists on a different network configuration.

This PR achieves that by getting rid of the
`removeNetworkConfiguration()` call triggered by `NetworkForm` and
patching the `NetworkController` with changes from
MetaMask/core#4614 which allow network
configurations to have their rpcUrl updated in place. It also keeps the
existing patch that removed a `lookupNetwork()` call in
`initializeProvider()`.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26453?quickstart=1)

## **Related issues**

Related: #26309

## **Manual testing steps**

1. Open extension in expanded view
2. Visit the Settings -> Networks
3. Add a network manually and add an rpc provider for Arbitrum One (for
your convenience, [chainlist.org](https://chainlist.org/chain/42161))
4. In the extension service worker console note the state via
`chrome.storage.local.get(console.log)` for
NetworkController.networkConfigurations
5. Visit the Network Form for that Network
6. Change the rpcUrl to a different valid one for Arbitrum 
7. In the extension service worker console check state via
`chrome.storage.local.get(console.log)`, the id for the network
configuration that was just edited should not have changed in
NetworkController.networkConfigurations
8. Visit a dapp, switch the chain to Arbitrum 
```
await window.ethereum.request({
  "method": "eth_requestAccounts",
});
await window.ethereum.request({
  "method": "wallet_switchEthereumChain",
  "params": [
    {
      "chainId": "0xa4b1"
    }
  ]
});
```
7. In the extension service worker console check state via
`chrome.storage.local.get(console.log)`, the dapp should have an entry
for the network client we added above SelectedNetworkController.domains
8. Again, Change the rpcUrl to a different valid one for Arbitrum 
9. In the extension service worker console check state via
`chrome.storage.local.get(console.log)`, the dapp should still be
pointed at the same network client id in
SelectedNetworkController.domains which should still exist in
NetworkController.networkConfigurations

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Fixes a newly introduced issue where the Snap home page would have
double padding since all Snap UI's are wrapped in `<Container>` as of
f461e37,
the container component adds 16px of padding by itself.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26462?quickstart=1)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Display max 15 characters, not max 15 digits, before ellipsis for
amounts shown in Permit pages. Updated to use `shortenString` here.

## **Related issues**

Fixes: MetaMask/MetaMask-planning#2845

## **Manual testing steps**

1. Go to test-dapp
2. Trigger Malicious Permit request
3. Observe ellipsis values in 
   a. spending cap in simulation
   b. value in the message

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

![CleanShot 2024-08-15 at 21 08
45](https://github.com/user-attachments/assets/020957dd-9204-40b6-afa2-9afacb80d9e0)

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

Allow `Footer` in Snap home pages, this works in the same way that the
new Snap dialogs does, with the exception that default footers are
turned off (e.g. a cancel button is not added automatically).

Also fixes a few padding problems with home pages. 

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26463?quickstart=1)

## **Related issues**

Closes: #25417

## **Manual testing steps**

1. Create a Snap that uses `<Footer>` in `onHomePage`
2. See that the footer now shows up
3. Install any existing Snap that doesn't use `Footer`
4. See that no footer is shown

## **Screenshots/Recordings**


https://github.com/user-attachments/assets/961ffa9e-59b4-452c-8b0f-906ba6e8c4be


![image](https://github.com/user-attachments/assets/0aecc66e-deb5-483b-acd2-504bc8679310)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This is another incremental migration, to use the shared/core libraries.
This replaces the extension push controller for the
`@metamask/notification-services-controller` push service controller.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26448?quickstart=1)

## **Related issues**

N/A

## **Manual testing steps**

Test full notifications flow, specifically the push notifications.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: MetaMask Bot <[email protected]>
…omRPC event (#26266)

## **Description**

Rather than arbitrarily sending `sha256` hashes over the wire, we should
instead handle the lookup/grouping of custom rpcs client-side, and then
send over the meaningful resource identifiers of commonly used.

Benefits are:
1. No post processing necessary
2. Bypasses the need to hash at all, since `rpcIdentifierUtility` should
only return the rpc host when there's a match (not for private eth
nodes, for instance)

Note:

1. `useSafeChains` hook is inspired by to be merged implementation
[here](https://github.com/MetaMask/metamask-extension/blob/brian/salim-build-test/ui/pages/settings/networks-tab/networks-form/use-safe-chains.ts)

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26266?quickstart=1)

## **Related issues**

Fixes: MMASSETS-298

## **Manual testing steps**

1. Go to settings and add a Custom network from the custom network form
2. Event will be emitted with `sensitiveProperties` once network gets
added

## **Screenshots/Recordings**

N/A UX behavior should be the same

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: legobeat <[email protected]>
…nce chunked (#26425)

`async` script tags execute as soon as the script is downloaded, whereas `defer` will executes in DOM order. We use `async` in our bundle when chunked (by webpack), and this could result in the JS being executed out of order. I haven't actually seen this race condition occur, but it seems possible.
This PR introduces a manual testing scenario aimed at ensuring the seamless upgrade of MetaMask extension from previous branch to the release branch. The primary goal is to validate that the upgrade process preserves user data, maintains essential functionality, handles popup modals related to upgrade news correctly, and does not introduce any disruptions to the user experience.
#23106 added a version of `prettier-eslint` which uses prettier v3. This project otherwise uses prettier v2. This downgrades the package to the latest version still supporting prettier v2.

## **Related issues**

- #23106
- #24828

Co-authored-by: Mark Stacey <[email protected]>
## **Description**

In #18347, we changed
the driver option `responsive` to `openDevToolsForTabs`. This was
because we had a new test suite that intended to test browser behaviour
related to Service Worker restart on manifest v3 builds. Later changes
to chrome's mv3 implementation meant that service worker no longer
restarted, and those e2e tests no longer exist
(`test/e2e/mv3/service-worker-restart.spec.js`).

However, this change had an unwanted side effect on another test suite
(`test/e2e/tests/metamask-responsive-ui.spec.js`). As @Gudahtt puts it
in a slack message:

> It looks like in this PR, the responsive option in the Chrome
webdriver was replaced with openDevToolsForTabs. This is functionally
what that option did, but this doesn't match the semantic purpose for
why the browser opened the dev tools.

> Browser driver options are shared between the Firefox and Chrome
drivers, so now they don't match. The test suite meant to test our UI in
a small viewport is now passing in the openDevToolsForTabs option, but
this doesn't work for the Firefox browser because it doesn't recognize
that option. So the tests are "passing" but they aren't actually running
the steps that are meant to be under test.

This PR reverts the option to its original name.

---------

Co-authored-by: Mark Stacey <[email protected]>
## **Description**

Adds NEAR Icon for ChainId `397` and `398`. These chains are currently
new networks being integrated onto EVM. They are currently in
development, but it was requested from their team to preemptively add
these icons, before production RPC endpoints are available.

For context, here is their proposal:
near/NEPs#518

https://chainlist.org/chain/397
https://chainlist.org/chain/398

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26459?quickstart=1)

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-343

## **Manual testing steps**

Once production RPCs are available, these icons should appear when NEAR
RPC gets added in custom networks.

## **Screenshots/Recordings**

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

Removes the modals prompting users to enable token + nft detection.

- Reverts #24281
- Reverts only the modal part of
#24547

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26403?quickstart=1)

## **Related issues**

## **Manual testing steps**

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This improve the network fee loading in the notification modal from ~3s
to ~1s.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26489?quickstart=1)

## **Related issues**

Fixes: N/A

## **Manual testing steps**

Test opening a notification.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<img width="525" alt="Screenshot 2024-08-17 at 18 19 40"
src="https://github.com/user-attachments/assets/bb9abe49-cbc9-4767-82de-656004dadb53">

<!-- [screenshots/recordings] -->

### **After**

<img width="523" alt="Screenshot 2024-08-17 at 18 20 44"
src="https://github.com/user-attachments/assets/c1ad87ba-54c3-487f-b6e7-7ba0e14d6478">

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
…ler (#26480)

## **Description**

This removes our old `MetaMaskNotificationsController` and uses our
shared `NotificationServicesController`. This controller is identical to
the old one, but replacing it so we have shared controllers for Mobile
and Extension.

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26480?quickstart=1)

## **Related issues**

Fixes: N/A

## **Manual testing steps**

Test Notifications flows

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: MetaMask Bot <[email protected]>
## **Description**

For a small number of users, migration 120.3 is failing due to invalid
`TransactionController.transactions` state. We aren't sure yet how this
is happening, but we can resolve the problem by updating the migration
to delete this invalid state if we detect it. No other state relies on
this state, and if it's invalid it won't work properly anyway.

The migration has been renamed from 120.3 to 120.6 so that it will be
re-run for any users who encountered this migration on v12.0.1 already.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26485?quickstart=1)

## **Related issues**

Fixes #26423

## **Manual testing steps**

* Create a dev build from v12.0.0
* Install the dev build from the `dist/chrome` directory and proceed
through onboarding
* Run this command in the background console:
  ```
  chrome.storage.local.get(
    null,
    (state) => {
      state.data.TransactionController.transactions = {};
      chrome.storage.local.set(state, () => chrome.runtime.reload());
    }
  );
  ```
* Disable the extension
* Switch to v12.0.1 and create a dev build
* Enable and reload the extension
  * You should see in the console that migration 120.3 has failed
* Disable the extension
* Switch to this branch and create a dev build
* Enable and reload the extension
* You should see in the console that migration 120.6 has run without
error
* You can run `chrome.storage.local.get(console.log)` to check that the
transactions state has been removed.


## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR integrates the `SnapInsightsController` and ports the existing
insights functionality to use this controller instead of the existing
hooks. This replaces our existing implementations with a
`useInsightSnaps` hook that returns all insights for a given
confirmation ID directly from the UI state.

The intention is that this matches the existing implementation as much
as possible, with one caveat that the timing for loading the insights
might have changed. Each insight is now added to state as soon as the
Snap responds.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26411?quickstart=1)

## **Related issues**

Closes: MetaMask/snaps#2568

## **Manual testing steps**

1. Install one or more transaction insights Snaps
2. Use the test-dapp to trigger transaction confirmations
3. See the transaction insights still works (including the modal)
4. Install one or more signature insights Snaps
5. Use the test-dapp to trigger signature confirmations
6. See that signature insights still works (including the modal)
…26449)

There are lots of tests that click a button in our popup window (AKA
"MetaMask Dialog") that _Eventually_ close the popup, but they don't
_wait_ for the popup to close before continuing on with the rest of the
test.

This can cause some race conditions due to the way our test
infrastructure finds windows (by title). The problem is that we look for
windows of the name "MetaMask Dialog", and in some cases we find 2, we
start referencing the first one, then it closes (as it should), and when
we try to reference it again Selenium throws (because the window no
longer exists).

So this PR introduces a new method
"driver.clickElementAndWaitForWindowToClose" that will click the element
(just as before), but then wait until the window closes before
returning.

Co-authored-by: Howard Braham <[email protected]>
The build instructions in the README are misleading at the moment because they make no reference to MV2. This could lead to contributors using MV3 builds with Firefox, leading to errors.

They have been updated to recommend the MV2 build commands when working with Firefox.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

This removes code fences for endowment:name-lookup Snap permission,
bringing this permission into main build out of Flask.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26393?quickstart=1)

## **Related issues**

Fixes MetaMask/snaps#2621

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
…d show tooltip if shortened (#26523)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26523?quickstart=1)

## **Related issues**

Fixes: #26520

## **Manual testing steps**

1. Go to test-dapp
2. Use ethereum mainnet network
3. Test malicious permit 

to test lengthier value: 

1. run `yarn storybook`
2. go to
http://localhost:6006/?path=/story/pages-confirmations-confirm-signatures-signedtypeddatav3orv4--permit-story&args=msgParams.data:3.0001231231212312e+22
3. copy and paste the following into data
```
"{\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"Permit\":[{\"name\":\"owner\",\"type\":\"address\"},{\"name\":\"spender\",\"type\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\"},{\"name\":\"nonce\",\"type\":\"uint256\"},{\"name\":\"deadline\",\"type\":\"uint256\"}]},\"primaryType\":\"Permit\",\"domain\":{\"name\":\"MyToken\",\"version\":\"1\",\"verifyingContract\":\"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\"chainId\":1},\"message\":{\"owner\":\"0x935e73edb9ff52e23bac7f7e043a1ecd06d05477\",\"spender\":\"0x5B38Da6a701c568545dCfcB03FcB875f56beddC4\",\"value\":30001231231212312138768,\"nonce\":0,\"deadline\":50000000000}}"
```

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<img width="320"
src="https://github.com/user-attachments/assets/d727cbf5-d729-4d31-b6fd-647692bdef30">

### **After**
<img width="320"
src="https://github.com/user-attachments/assets/4171d4b9-44ca-418d-8f79-017f59d8edfc">

### **After with tooltip showing on lengthy fiat value**
<img width="320"
src="https://github.com/user-attachments/assets/9f2dfcbe-3f34-4ce3-9394-667f4fd2dd54">


## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
## **Description**
Because of concerns around Snap custom UI address component not working
as intended with _Pet Names_, decision was made to disable it's
interactive UX and display shortened hexadecimal address instead of
showing _Pet name_.

Changes on this PR will make Address component to ignore clicks and
triggering the modal for nicknames.

Changes are applied only to Snaps related flows where Snaps components
(custom UI) are used.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26477?quickstart=1)

## **Related issues**
Fixes: MetaMask/MetaMask-planning#2965

## **Manual testing steps**
1. Try using a Snap with Custom UI which has Address component.
2. Try clicking on the Address component.
3. Nothing should happen when Address component is clicked.
4. Make sure that address component is not displaying nicknames (only
short hex address is required).

## **Screenshots/Recordings**
### **Before**
![Screenshot 2024-08-19 at 16 49
24](https://github.com/user-attachments/assets/fa9a83a4-5255-42ed-97af-39f4606de365)

### **After**
Customized Interactive UI Snap for the test case, just for reference:
![Screenshot 2024-08-19 at 16 44
51](https://github.com/user-attachments/assets/260b7afa-65f8-446b-aa78-8c3f95b0ae30)

## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

This PR fixes an issue where the STX status screen for a swap was
showing a 0:00 for the timer.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25779?quickstart=1)

## **Related issues**

Related to: #25063

## **Manual testing steps**

1. Make sure Smart Transactions is on (Settings > Advanced)
2. Do a Swap
3. Observe that timer is not 0:00 and is a reasonable number

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->


https://github.com/MetaMask/metamask-extension/assets/139582705/26fe6167-614f-4771-b35b-10803bc23fc0



### **After**

<!-- [screenshots/recordings] -->


https://github.com/MetaMask/metamask-extension/assets/139582705/d92b933d-1011-48b4-bf04-344f275d35db



## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

---------

Co-authored-by: Marta Poling <[email protected]>
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26197?quickstart=1)

After migrating the global unit tests from Mocha to Jest, the
`protect-intrinsics` test started to fail. It seems that the jest
environment is not compatible with the lockdown `protect-intrinsics`
intends to test. Furthermore, as this test is testing the lockdown of
the browser environment, it would probably make more sense to test it in
a browser.

For this reason, this PR migrates the protect-intrinsics test to run as
part of the e2e test suite, as the browser would be a better test
environment, closer to production.

## **Related issues**

Fixes: MetaMask/MetaMask-planning#2907

## **Manual testing steps**

1. Run `test:e2e:global` and see the tests pass

## **Screenshots/Recordings**

Not applicable

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Gudahtt and others added 7 commits August 29, 2024 18:14
## **Description**

Migration 121.1 has been updated to include more state validation, so
that it does not throw an error in the event that state is corrupted in
some unexpected way. Unexpected corrupted state is now reported to
Sentry as well.


[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26773?quickstart=1)

## **Related issues**

Related: #26377

## **Manual testing steps**

The unit tests outline the scenarios that the added validation are meant
to cover. Probably not worth anyone's time to manually test those.

To test the migration in general though, here are the steps:

* Create a dev build from v12.1.0
* Install the dev build from the `dist/chrome` directory and proceed
through onboarding
* Run this command in the background console: ```
chrome.storage.local.get( null, (state) => {
state.data.AccountsController.internalAccounts.selectedAccount =
'unknown id';
chrome.storage.local.set(state, () => chrome.runtime.reload()); } ); ```
  * The extension should now be in a broken state
* Note that you can use this same script to corrupt state in other ways
to test other scenarios
* Disable the extension
* Switch to this branch and create a dev build
* Enable and reload the extension
* You should see in the console that migration 121.1 has run without
error
* You can run `chrome.storage.local.get(console.log)` to check that the
AccountsController state is now valid
  * The extension should no longer be broken

## **Screenshots/Recordings**

N/A

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
## **Description**

<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/25839?quickstart=1)

This PR introduces three new updates to the MetaMask extension with the
new phishing controller version 12.0.0.

1. **Removal of PhishFort List References**: MetaMask no longer has a
contract with PhishFort and has also been introducing false positives to
the blocklist, all references to the PhishFort blocklist have been
removed as we no longer use their list in the new PhishingController
version.

2. **Support for Checking Malicious IPFS Domains**: The phishing
controller now includes support for detecting and blocking known
malicious IPFS domains.

3. **Management of a C2 Domain Blocklist**: The PhishingController now
supports a client-side blocklist specifically for Command & Control (C2)
domains. The extension now checks network requests against this
blocklist and redirects users the the phishing warning page.

## **Manual testing steps**

1. Go to a website known to be on the C2 domain blocklist. For now we
made our test website `https://develop.d3bkcslj57l47p.amplifyapp.com/`
have a malicious C2 Request that is on our blocklist.
2. Attempt to interact with the site.
3. Verify that on visiting the website you get redirected to the red
Metamask phishing page.
5. Repeat with a site that is not on the blocklist to confirm normal
operation.

<!-- [Insert screenshots/recordings showing network requests being
blocked with a warning message] -->

## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability.
- [x] I’ve included tests for the new client-side detection feature.
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
where applicable.
- [x] I’ve applied the right labels on the PR.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g., pulled and built the branch,
run the app, tested the code changes).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and/or screenshots.

---------

Co-authored-by: Jacob Lebowitz <[email protected]>
Co-authored-by: MetaMask Bot <[email protected]>
## **Description**

Add `POL` token image, and maps it to Polygon Network config. See [blog
post](https://polygon.technology/blog/save-the-date-matic-pol-migration-coming-september-4th-everything-you-need-to-know)
for more context.

Adds chain collision check to not flag `POL` as scam token

Adds migration to overwrite `MATIC` ticker to `POL`

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26671?quickstart=1)

## **Related issues**

Fixes: https://consensyssoftware.atlassian.net/browse/MMASSETS-362

## **Manual testing steps**

1. When adding Polygon as a network from `FEATURED_RPCS`, ticker symbol
should be POL
2. When switching to Polygon Mainnet, ticker should be POL (not MATIC)
2. Can import `Polygon Network Token` on Ethereum Mainnet
3. Can import `Matic Network Token` on Ethereum Mainnet (backward
compatibility)

> Note, that both `MATIC` and `POL` erc20 tokens can already be imported
on Ethereum Mainnet, so this behavior should remain unchanged.

Additionally, when a user upgrades to this build, migration should run
and overwrite ticker from MATIC to POL:

1. Install a previous build (checkout `develop` and `yarn && yarn start`
should be fine here) -> Polygon Network should show `MATIC` as ticker.
You may need to remove and re-add Polygon Network, as migrations are
incremental.
2. checkout to this branch, `yarn && yarn start`, migration 128 should
run (Running migration 128... in console) -> Polygon Network should show
`POL` as ticker

## **Screenshots/Recordings**

Before:

<img width="358" alt="Screenshot 2024-08-27 at 2 39 15 PM"
src="https://github.com/user-attachments/assets/241b6d60-03a9-49fa-9b1e-61aeeb8b3f9f">
<img width="358" alt="Screenshot 2024-08-27 at 2 39 36 PM"
src="https://github.com/user-attachments/assets/fc3f933e-3b27-4dbe-943b-3453a9967687">


After:

<img width="356" alt="Screenshot 2024-08-27 at 1 47 40 PM"
src="https://github.com/user-attachments/assets/5e849387-3a16-471c-8587-33ea40ca7a81">
<img width="357" alt="Screenshot 2024-08-27 at 1 48 11 PM"
src="https://github.com/user-attachments/assets/fd96c3c8-560b-4e06-aa0a-07c3838d5e0b">


## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
…s` (#26792)

<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**
The snap fails at the point of trying to find the scrolll element. The
problem is that the previous `Connect` action takes several seconds, and
the default timeout for the next action is not enough (1000ms) -- see
video.
In this PR we increase the timeout to 3000ms.
Note: having a bigger timeout is safe, as if the condition is met
earlier, it will jump to the next step, so we won't wait for the
complete 3000ms when it's not needed.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26792?quickstart=1)

## **Related issues**

Fixes: #26793

## **Manual testing steps**

1. Check ci

## **Screenshots/Recordings**
See how the Connect action takes some time, making the subsequent action
to fail, as the scroll element cannot be located within the timeout


https://github.com/user-attachments/assets/5c38cf2c-a15f-47a1-8279-6f200747f69e



## **Pre-merge author checklist**

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [x] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

Cherry picks: #26867
into V12.5.0

## **Description**

Moves the portfolio button so that it's next to the token price amount.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26867?quickstart=1)

## **Related issues**

Fixes: MetaMask/MetaMask-planning#3201

## **Manual testing steps**

1. Go to the portfolio page
2. Check that the Portfolio button is present next to the price amount
of token
3. Click it to test it works fine

## **Screenshots/Recordings**

<img width="324" alt="Screenshot 2024-09-03 at 22 57 32"
src="https://github.com/user-attachments/assets/ab9a9818-d9d1-438e-9b66-1335c4e8c1c6">
<img width="331" alt="Screenshot 2024-09-03 at 22 58 54"
src="https://github.com/user-attachments/assets/f260799c-9e22-40dd-8fb8-1d26d3c011ed">



### **Before**

<img width="348" alt="Screenshot 2024-09-03 at 15 46 36"
src="https://github.com/user-attachments/assets/ca261c96-dd93-4699-8e51-d73cf5823cb2">


### **After**

<img width="331" alt="Screenshot 2024-09-03 at 22 58 54"
src="https://github.com/user-attachments/assets/f260799c-9e22-40dd-8fb8-1d26d3c011ed">


## **Pre-merge author checklist**

- [X] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [X] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [X] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [X] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [X] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

We show a third party notice when installing or connecting to a Snap for
the first time. Preinstalled Snaps are first party Snaps however, so we
don't need to show the warning for these Snaps. I've implemented some
logic that checks if the requested Snap is a preinstalled Snap, and only
show the third party notice if it's not.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27319?quickstart=1)

Fixes: MetaMask/MetaMask-planning#3325.

Assuming you have not accepted the third party notice before:

1. Go to [the Test Snaps
page](https://metamask.github.io/snaps/test-snaps/latest/)
2. Connect to the preinstalled Snap, and verify the notice is _not_
shown
3. Connect to any other Snap, and verify that the notice _is_ shown

- [x] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [x] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@github-actions github-actions bot added the team-snaps-platform Snaps Platform team label Sep 24, 2024
@Mrtenz Mrtenz changed the title fix: Don't show third party notice for preinstalled Snaps (#27319) fix: Don't show third party notice for preinstalled Snaps Sep 24, 2024
@metamaskbot metamaskbot added the INVALID-PR-TEMPLATE PR's body doesn't match template label Sep 24, 2024
@Mrtenz Mrtenz marked this pull request as ready for review September 24, 2024 06:09
@Mrtenz Mrtenz requested review from a team as code owners September 24, 2024 06:09
GuillaumeRx
GuillaumeRx previously approved these changes Sep 24, 2024
@Mrtenz Mrtenz changed the base branch from Version-v12.4.0 to Version-v12.3.0 September 24, 2024 14:17
@Mrtenz Mrtenz dismissed GuillaumeRx’s stale review September 24, 2024 14:17

The base branch was changed.

@Mrtenz Mrtenz requested review from a team and kumavis as code owners September 24, 2024 14:17
@Mrtenz
Copy link
Member Author

Mrtenz commented Sep 24, 2024

Going to recreate this.

@Mrtenz Mrtenz closed this Sep 24, 2024
@Mrtenz Mrtenz deleted the mrtenz/cherry-pick-5cc14af branch September 24, 2024 14:18
@github-actions github-actions bot locked and limited conversation to collaborators Sep 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
INVALID-PR-TEMPLATE PR's body doesn't match template team-snaps-platform Snaps Platform team
Projects
None yet
Development

Successfully merging this pull request may close these issues.