I would like to write a small Electron application using Two.js but I realized Electron doesn't like anyone to use eval
.
If I do this in renderer.js
:
let u = eval('1 + 1');
I get this issue:
Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'".
Of course I enabled allowRunningInsecureContent: true
in the webPreferences
.
Is there any way of running packages that use eval
in Electron?