MetaMask / MetaMask/metamask-extension

Provide method for UI console to issue its actions

Open
#9,879 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type-enhancement
Dominant language
TypeScript
Stars
13.2k
Forks
5.6k
Avg merge
2d 5h
Merged PRs (30d)
451

Description

Maybe just putting the background (dnode) object on the global, so that the UI's own behaviors can be triggered by the console.

This would allow console-based invocation of any UI feature that is having problems.

The idea came from how the SNX token recently broke all other tokens loading. A simple command to tell users to run in the console would be a much cleaner workaround than asking them to reinstall.

Downsides:

  • Hard to imagine the future benefits, it's a general purpose bug workaround feature.
  • Adding an object to global scope violates all kinds of POLA, so I would only even consider doing this in the UI. We once did something like this in the background then realized it meant every dep had easy access to the whole operation, so that should be off the table.

Benefits:

  • Pretty easy to do, easy workarounds in the future.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the UI accesses the background (dnode) object and how the console is attached; the issue names no files or tests. Define the UI-only exposure boundary and verify that a console command can invoke a UI action without exposing the background object globally.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.