- 问题描述
- nginx配置了
add_header Content-Security-Policy "script-src 'self'";
- nginx配置了
- 浏览器报错
- Refused to load the script ‘xxxx’ because it violates the following Content Security Policy directive: “script-src ‘self’ https://webapi.amap.com ‘unsafe-inline’ ‘unsafe-eval’ blob: data:”. Note that ‘script-src-elem’ was not explicitly set, so ‘script-src’ is used as a fallback.
- Refused to load the script ‘xxxx’ because it violates the following Content Security Policy directive: “script-src ‘self’ https://webapi.amap.com ‘unsafe-inline’ ‘unsafe-eval’ blob: data:”. Note that ‘script-src-elem’ was not explicitly set, so ‘script-src’ is used as a fallback.
- 解决办法
add_header Content-Security-Policy "script-src 'self' https://webapi.amap.com 'unsafe-inline' 'unsafe-eval' blob: data:;";
高德地图脚本加载异常,浏览器报错
最新推荐文章于 2025-02-19 16:26:59 发布