1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-23 02:10:12 +01:00
metamask-extension/development
kumavis 66bd172980
Lavamoat - protect all UI contexts (#14537)
* lavamoat - apply lavamoat protections to popup and notification

* build - enable lavamoat for home

* lavamoat - add missing ui overrides for react family

* deps/patches - patch zxcvbn for ses compat
2022-04-28 08:45:46 -10:00
..
build Lavamoat - protect all UI contexts (#14537) 2022-04-28 08:45:46 -10:00
highlights Add JSDoc ESLint rules (#12112) 2022-01-07 12:27:33 -03:30
lib Derive version suffix from build type and version (#13895) 2022-03-10 12:31:50 -03:30
states Support for GridPlus Lattice1 hardware wallet (#12053) 2021-11-08 11:18:41 -03:30
announcer.js Migrate version from _base manifest to package.json (#11029) 2021-05-10 14:16:03 -07:00
chromereload.js Build - refactor background process to use html (#10769) 2021-03-31 11:12:28 +08:00
create-static-server.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
empty.js Build - refactor background process to use html (#10769) 2021-03-31 11:12:28 +08:00
generate-lavamoat-policies.sh Run main, flask and beta in sequence in generate-lavamoat-policies.sh (#14470) 2022-04-19 11:13:47 -02:30
generate-migration.sh Fixing migration script generation paths (#10664) 2021-03-17 12:21:46 +08:00
gource-viz.sh dev - move gource instructions from docs to development script 2019-09-10 22:05:16 +08:00
jest.config.js Update Jest coverage reporters (#12845) 2021-12-01 15:16:34 -03:30
metamaskbot-build-announce.js Update metamaskbot-build-announce.js (#14320) 2022-03-31 16:11:59 -10:00
missing-locale-strings.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
mock-3box.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
mock-segment.js Remove unused SEGMENT_LEGACY_WRITE_KEY (#12429) 2021-10-22 10:34:37 -02:30
README.md Docs - segment metrics (#14435) 2022-04-19 16:15:41 +01:00
run-ganache.sh Adding support for EIP-1559 in E2E tests (#13282) 2022-01-19 04:38:41 +05:30
sentry-publish.js Automate the Flask release process (#13898) 2022-03-15 08:54:37 -02:30
sentry-upload-artifacts.sh Automate the Flask release process (#13898) 2022-03-15 08:54:37 -02:30
shellcheck.sh Add lint:shellcheck:package (#7568) 2019-12-11 15:52:08 -05:00
show-deps-install-scripts.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
source-map-explorer.sh Excluding sourcemaps comment in production builds (#10695) 2021-03-22 19:41:23 -07:00
sourcemap-validator.js Using a normal bundle instead of a factored bundle for phishing-detect (build sys) (#11972) 2021-08-30 17:58:50 -10:00
static-server.js @metamask/eslint config@5.0.0 (#10358) 2021-02-04 10:15:23 -08:00
stream-flat-map.js Build - refactor for bundle factoring and swappable runtime (#11080) 2021-07-15 10:59:34 -07:00
verify-locale-strings.js Fix manifest i18n substitutions for Beta and Flask (#12717) 2021-11-16 08:43:21 -08:00

Development

Several files which are needed for developing on MetaMask.

Usually each file or directory contains information about its scope / usage.

Segment

Debugging with the Mock Segment API

To start the Mock Segment API:

  • Add/replace the SEGMENT_HOST and SEGMENT_WRITE_KEY variables in .metamaskrc
    SEGMENT_HOST='http://localhost:9090'
    SEGMENT_WRITE_KEY='FAKE'
    
  • Build the project to the ./dist/ folder with yarn dist
  • Run the Mock Segment API from the command line
    node development/mock-segment.js
    

Events triggered whilst using the extension will be logged to the console of the Mock Segment API.

More information on the API and its usage can be found here.

Debugging in Segment

To debug in a production Segment environment:

  • Create a free account on Segment
  • Create a New Workspace
  • Add a Source (Node.js)
  • Copy the Write Key from the API Keys section under Settings
  • Add/replace the SEGMENT_HOST and SEGMENT_WRITE_KEY variables in .metamaskrc
    SEGMENT_HOST='https://api.segment.io'
    SEGMENT_WRITE_KEY='COPIED_WRITE_KEY'
    
  • Build the project to the ./dist/ folder with yarn dist

Events triggered whilst using the extension will be displayed in Segment's Debugger.

Debugging Segment requests in MetaMask

To opt in to MetaMetrics;

  • Unlock the extension
  • Open the Account menu
  • Click the Settings menu item
  • Click the Security & Privacy menu item
  • Toggle the Participate in MetaMetrics menu option to the ON position

You can inspect the requests in the Network tab of your browser's Developer Tools (background.html) by filtering for POST requests to /v1/batch. The full url will be http://localhost:9090/v1/batch or https://api.segment.io/v1/batch respectively.