图片报错:
html
Refused to load the image 'blob:because it violates the following Content Security Policy directive: "img-src 'self' data:".
视频报错:
html
Refused to load media from 'blob:because it violates the following Content Security Policy directive: "default-src 'self'". Note that 'media-src' was not explicitly set, so 'default-src' is used as a fallback.
我们怎么解决呢?
就是在渲染进程的index.html里head标签里更改第二个meta
html
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self' blob:;
script-src 'self';
style-src 'self' 'unsafe-inline';
img-src 'self' data: blob:;
media-src 'self' blob:;
font-src 'self';
connect-src 'self'"
/>