Using inversify in Electron renderer process when enabling sandbox
Current Behavior
I can not use inversify in Electron renderer process when enabling sandbox while when disabling sandbox will be OK, and it's OK when using it from the main process that can use nodejs on all the cases.
Context
Electron v20 has a breaking change https://github.com/electron/electron/pull/35125 , after enabling sandbox we got an error Error: module not found: inversify that will prevent loading the preload script, while when disabling sandbox will be OK, but we would like to apply Electron recommendations for the security on our app.
I created an issue to Electron on GitHub about this case https://github.com/electron/electron/issues/36437, they said: "This is happening because your preload script is trying to use node in the renderer process, which Electron no longer allows by default."
Any suggestions to use inversify without nodejs.
Your Environment
Version used: inversify v6.0.1
Environment name and version (e.g. Chrome 39, node.js 5.4): Electron v20 and up
Operating System and version (desktop or mobile): Windows OS
Link to your project: Here is a quick app on GitHub to reproduce the issue
Expected Behavior
Using
inversify
in Electron renderer process when enablingsandbox
Current Behavior
I can not use
inversify
in Electron renderer process when enablingsandbox
while when disablingsandbox
will be OK, and it's OK when using it from themain process
that can use nodejs on all the cases.Context
v20
has a breaking change https://github.com/electron/electron/pull/35125 , after enablingsandbox
we got an errorError: module not found: inversify
that will prevent loading the preload script, while when disablingsandbox
will be OK, but we would like to apply Electron recommendations for the security on our app.inversify
without nodejs.Your Environment
v6.0.1
v20
and up