Electron 中 lordicon 无法显示

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


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部