Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Console的错误贴图:

chrome : https://cl.ly/132h1I2P2U3i

firefox : https://cl.ly/2T3p0X100P3K

错误显示: A Parser-blocking, cross-origin script, https://ajax.cloudflare.com/c... is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/... for more details.

firefox 显示 4 个升级 http 到 https 的请求,我应该在哪里升级呢?

自己一开始为了消除 mixed contents 错误,把 nginx 里面的 nginx.conf 的 server {}中添加

server { ...

add_header Content-Security-Policy upgrade-insecure-requests;

...} 请大家指导


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
312 views
Welcome To Ask or Share your Answers For Others

1 Answer

我自己的博客也遇到了相关的问题,但是我的不是error,而是warn,内容大致如下:

A Parser-blocking, cross-origin script, http://edge.yunjiasu.com/cdn-cgi/nexp/dok3v=f2befc48d1/cloudflare.min.js, is invoked via document.write. This may be blocked by the browser if the device has poor network connectivity. See https://www.chromestatus.com/feature/5718547946799104 for more details.

我来简述下我的解析吧:

  1. 首先,我用了某某云加速免费版的产品,其中开启了cdn功能(这里不方便说出名字,以免说我广告)

  2. 第二,我在chrome中调试了我的网站(blog.liuyingguang.cn),发现头部被强制加了脚本,也许这些脚本是供供应商做数据采集用的,anyway,不影响我网站具体功能

<script type="text/javascript">
//<![CDATA[
try{if (!window.CloudFlare) {var CloudFlare=[{verbose:0,p:1490667265,byc:0,owlid:"cf",bag2:1,mirage2:0,oracle:0,paths:{cloudflare:"/cdn-cgi/nexp/dok3v=1613a3a185/"},atok:"ff08a4f401343ca0fb2785414997207e",petok:"7d31742f8f162ecbf3db44f5cea3dc149f8b7e26-1490750651-14400",zone:"liuyingguang.cn",rocket:"a",apps:{}}];document.write('<script type="text/javascript" src="//edge.yunjiasu.com/cdn-cgi/nexp/dok3v=f2befc48d1/cloudflare.min.js"><'+'/script>');}}catch(e){};
//]]>
</script>
  1. cloudflare目前有一个开源项目,也许国内很多cdn厂商使用了开源项目中的部分内容

上面部分分析内容,希望对你有用


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...