electron 'unsafe-eval'

electron 出现如下警告

1
2
3
4
5
6
7
8
Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security
Policy set or a policy with "unsafe-eval" enabled. This exposes users of
this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.

main.js(入口文件)添加一行代码

1
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = 'true';
  • © 2020-02 MonkeyInWind
  • GitHub

请我喝杯咖啡吧~