MetaMask / MetaMask/metamask-extension

Endless loading of the custom build of MetaMask Extension

Open
#21,484 3 comments 0 reactions 0 assignees View on GitHub
external-contributor team-wallet-api-platform-deprecated
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

### What is this about?

I am trying to use **MetaMask** in my project through **selenium** for authentication. I made changes according to the `.readme` and this solution. However, after compiling and launching MetaMask from `/dist/chrome`, I see an endless window loading in the Chrome selenium tab.

```
\metamask-extension>yarn dist
Building lavamoat runtime file (scuttling is on)
Running task "dist"...
Starting 'dist'...
Starting 'clean'...
Finished 'clean'
Starting 'styles:prod'...
LavaMoat: ignoring write attempt to read-access global "process"
LavaMoat: ignoring write attempt to read-access global "__dirname"
LavaMoat: ignoring write attempt to read-access global "__filename"
LavaMoat: ignoring write attempt to read-access global "Buffer"
Finished 'styles:prod'
Starting 'scripts:core:dist:standardEntryPoints'...
Starting 'scripts:core:dist:contentscript'...
Starting 'scripts:core:dist:disable-console'...
Starting 'scripts:core:dist:sentry'...
Starting 'static:prod'...
Starting 'manifest:prod'...
Finished 'manifest:prod'
Finished 'static:prod'
scripts:core:dist:contentscript: Bundle start: "inpage"
scripts:core:dist:disable-console: Bundle start: "disable-console"
scripts:core:dist:disable-console: Bundle end: "disable-console"
Finished 'scripts:core:dist:disable-console'
scripts:core:dist:standardEntryPoints: Bundle start: "primary"
scripts:core:dist:sentry: Bundle start: "sentry-install"
scripts:core:dist:contentscript: Bundle end: "inpage"
scripts:core:dist:contentscript: Bundle start: "contentscript"
scripts:core:dist:sentry: Bundle end: "sentry-install"
Finished 'scripts:core:dist:sentry'
scripts:core:dist:contentscript: Bundle end: "contentscript"
Finished 'scripts:core:dist:contentscript'
scripts:core:dist:standardEntryPoints: Bundle end: "primary"
Finished 'scripts:core:dist:standardEntryPoints'
Starting 'zip'...
Finished 'zip'
Finished 'dist'

Build completed. Task timeline:
█████████████████████████████████████████ dist 454.6s
█ clean 0.1s
█▊ styles:prod 8.7s
▕███████████████████████████████████████▉ scripts:core:dist:standardEntryPoints 444.1s
▕███████████████████████▎ scripts:core:dist:contentscript 255.7s
▕█████████████████████▍ scripts:core:dist:disable-console 234.1s
▕█████████████████████▉ scripts:core:dist:sentry 239.9s
▕▉ static:prod 1.8s
▕▊ manifest:prod 0.1s
▕█ zip 1.7s

\metamask-extension>
```

### Scenario

1. git clone `https://github.com/MetaMask/metamask-extension`
2. Duplicate `.metamaskrc.dist` within the root and rename it to `.metamaskrc`
3. Edit `metamask-extension\development\build\index.js` 153:
from `enabled: applyLavaMoat && shouldScuttle,` to `enabled: false,`
4. In the duplicated file `.metamaskrc` set **INFURA_PROJECT_ID, PASSWORD, SEGMENT_WRITE_KEY**
5. `yarn install`
6. `yarn dist`

### Design

![screenshot](https://i.imgur.com/2uOcgVb.jpg)
![screenshot](https://i.imgur.com/bTfL4QH.jpg)
![screenshot](https://i.imgur.com/1eoLBts.jpg)

### Technical Details

_No response_

### Threat Modeling Framework

_No response_

### Acceptance Criteria

_No response_

### References

[Runtime.callFunctionOn threw exception: Error: LavaMoat - property "Proxy" of globalThis is inaccessible under scuttling mode](https://stackoverflow.com/questions/76252205/runtime-callfunctionon-threw-exception-error-lavamoat-property-proxy-of-gl)

[https://github.com/LavaMoat/LavaMoat/pull/360#issuecomment-1547726986](https://github.com/LavaMoat/LavaMoat/pull/360#issuecomment-1547726986)

Contributor guide

Open the contributing guide

Research direction

Reproduce the custom build from development/build/index.js using the .metamaskrc settings, then inspect the generated /dist/chrome extension in the Chrome Selenium tab and its console. Compare behavior with LavaMoat scuttling enabled or disabled; done means the built extension loads instead of remaining on the endless loading screen.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
build-system, frontend, security
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.