-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Cherry picking #26697 to V12.3.0 #26697 sets up a stream communication with the label 'metamask-cookie-handler'. The data sent from the page will be intercepted at the content-script and forwarded to the extension. The 'ga_client_id' sent from the page is saved as `marketingCampaignCookieId` in the metaMetricsController state and fetched when building the context for each event. <!-- 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/27227?quickstart=1) ## **Related issues** Fixes: ## **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** - [ ] 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.
- Loading branch information
1 parent
63cf08b
commit 3373b9a
Showing
14 changed files
with
703 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export const COOKIE_ID_MARKETING_WHITELIST = [ | ||
'https://metamask.io', | ||
'https://learn.metamask.io', | ||
'https://mmi-support.zendesk.com', | ||
'https://community.metamask.io', | ||
'https://support.metamask.io', | ||
]; | ||
|
||
if (process.env.IN_TEST) { | ||
COOKIE_ID_MARKETING_WHITELIST.push('http://127.0.0.1:8080'); | ||
} | ||
|
||
// Extract the origin of each URL in the whitelist | ||
export const COOKIE_ID_MARKETING_WHITELIST_ORIGINS = | ||
COOKIE_ID_MARKETING_WHITELIST.map((url) => new URL(url).origin); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// contexts | ||
export const CONTENT_SCRIPT = 'metamask-contentscript'; | ||
export const METAMASK_INPAGE = 'metamask-inpage'; | ||
|
||
// stream channels | ||
export const METAMASK_PROVIDER = 'metamask-provider'; | ||
export const METAMASK_COOKIE_HANDLER = 'metamask-cookie-handler'; | ||
export const PHISHING_SAFELIST = 'metamask-phishing-safelist'; | ||
export const PHISHING_STREAM = 'phishing'; | ||
|
||
// For more information about these legacy streams, see here: | ||
// https://github.com/MetaMask/metamask-extension/issues/15491 | ||
// TODO:LegacyProvider: Delete | ||
export const LEGACY_CONTENT_SCRIPT = 'contentscript'; | ||
export const LEGACY_INPAGE = 'inpage'; | ||
export const LEGACY_PROVIDER = 'provider'; | ||
export const LEGACY_PUBLIC_CONFIG = 'publicConfig'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.