解决HTTPS嵌套HTTP的问题
+function(){
var a=document.createElement("meta");
var b=document.createElement("meta");
a.httpEquiv = "X-Webkit-CSP";
b.httpEquiv = "Content-Security-Policy";
a.content = b.content = "upgrade-insecure-requests";
if(location.protocol==='https:'){
document.head.insertAdjacentElement('afterbegin',b);
document.head.insertAdjacentElement('afterbegin',a);
}
}();
网友评论