chrome extension (manifest V3) which injects a string "hello_world" to window.ethereum object in all the tabs in chrome

36 Views Asked by At

I am trying to build a chrome extension as a crypto wallet. I spent a lot of time on how to inject something to window.ethereum object. Something like window.ethereum = "hello_world". So that when I go to any tab in chrome and if I execute window.ethereum in devtools console, I should see "hello_world" string as output.

It feels like simple thing. But I am stuck here. Please help on this.

Give me the code with these files:

  1. chrome extension's popup.html
  2. contentScript.html
  3. background.js
  4. manifest.json
0

There are 0 best solutions below