MetaMask / MetaMask/extension-provider

I want to be able to connect to meta mask browser extension from a chrome extension tab loaded application

Open
#30 0 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
73
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Greetings

I want to be able to connect to meta mask browser extension from a chrome extension tab loaded application.

However when I use a background script of the chrome extension to open my own extension app in a tab, it does not have access to the chrome namespace. The chrome variable is undefined.

i.e. in https://github.com/MetaMask/extension-provider/blob/master/index.js

this code will fail:

`const metamaskPort = chrome.runtime.connect(currentMetaMaskId)`

What I want to do is connect my wallet to the tab extension url which looks like this:

`chrome-extension://oahhaapnfpkfnbgeopliehfgenifngde/tab.html#/register`

i.e. I want the wallet connected to the chrome extension app and not the domain the content script happens to be on.

Thank you for your time

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading index.js, especially the chrome.runtime.connect(currentMetaMaskId) entry point described in the issue. Investigate how the extension-provider module can reach a MetaMask instance from a chrome-extension:// tab, and define done as successfully connecting the wallet from the extension app rather than the content-script domain.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.