HTTPS頁面里動態的引入HTTP資源,比如引入一個js文件,會被直接block掉的.在HTTPS頁面里通過AJAX的方式請求HTTP資源,也會被直接block掉的。
Mixed Content: The page at 'xxx' was loaded over HTTPS, but requested an insecure resource 'xxx'. This request has been blocked; the content must be served over HTTPS.
解決辦法:
頁面的head中加入:
<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
意思是自動將http的不安全請求升級為https