Electron 中 lordicon 无法显示

Electron 中 lordicon 无法显示,第1张

Electron 中 lordicon 无法显示 报错1:electron properties of undefined (reading ‘effectsManager’

调试发现是src="https://cdn.lordicon.com/*.json"未加载导致。但被try catch了

实际报错: ‘unsafe-eval’ is not an allowed

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’”.

违反了Content Security Policy指令。

<meta  http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'"/>
临时解决

添加 unsafe-eval

其他 Refused to connect to XXX

that ‘connect-src’ was not explicitly set, so ‘default-src’ is used as

Refused to load the image 'data:image/svg+xml,%3csvg

参考

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/944581.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-18
下一篇 2022-05-18

发表评论

登录后才能评论

评论列表(0条)

保存