📜  Ajax 混合内容被阻止 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:38.788000             🧑  作者: Mango

代码示例1
if (window.location.protocol.indexOf('https') == 0){
  var el = document.createElement('meta')
  el.setAttribute('http-equiv', 'Content-Security-Policy')
  el.setAttribute('content', 'upgrade-insecure-requests')
  document.head.append(el)
}