0

I'm currently working on an IPFS/Ethereum dapp in Muon. Because i need Metamask i started with this Boilerplate: https://github.com/SwapyNetwork/electron-metamask-boilerplate

Everything is working fine so far. However i can not use require('anything') in the renderer process or in html script tags. (See below)

There seems to be a problem with the boilerplate code but i can't find it. Or is node code in renderer not supported in Muon?

My only change in testing is setting node-integration explicitly to true and inserting require('fs') in index.js. (i installed fs of course).

I tried many different solutions from stackoverflow and other sites but couldn't find a solution yet.

Error Message

Thank you

Sauseee
  • 45
  • 1
  • 6

1 Answers1

0

As per the muon's github repo:

Some of Muons goals include:

  1. Use the Chromium source directly (eliminating electron's copy of chrome_src) with minor patches
    • make integrating chrome components less painful
    • faster and more streamlined end-to-end build process (see browser-laptop-bootstrap).
  2. add support for Chrome extensions
  3. add security focused features for the renderer:
    • remove node completely (from the renderer process)
    • full sandbox
    • scriptable window.opener support

As you can see there, muon does not supports node code in the rendered. It is by design for security purpose. Muon may be great for certain applications, but I recommend switching on to electron if you really need to use require in the renderer.

Nishkal Kashyap
  • 960
  • 7
  • 17