0

I'm building chrome extension wallet from scratch and I want to add global variable like window.ethereum from metamask.
I've tried to simply add this code to the background.js but it does not work.

window.alternativeForEthereum = {};

Now I want to find a way to provide interface for all web pages which interacts with my wallet so that the pages can send requests to the wallet directly.
The target workflow is extremely similar to accessing account logic from metamask.

Thank you in advance and any answer will be highly appreciated.

Count-Monte
  • 11
  • 1
  • 4
  • See [this answer](https://stackoverflow.com/a/9517879) and run this line of code in the web page context. – wOxxOm May 05 '22 at 11:51

0 Answers0