​​​何為“Secure Contexts”安全內容? 終於說明白了!

看圖說話

【途徑1】:位址列輸入: edge://flags/

按需設定選項後,重啟瀏覽器即可。

Allow invalid certificates for resources loaded from localhost.

Allows requests to localhost over HTTPS even when an invalid certificate is presented. – Mac, Windows, Linux

#allow-insecure-localhost

選項:已禁用                   已啟用 

Block insecure private network requests.

Prevents non-secure contexts from making sub-resource requests to more-private IP addresses. An IP address IP1 is more private than IP2 if 1) IP1 is localhost and IP2 is not, or 2) IP1 is private and IP2 is public. This is a first step towards full enforcement of CORS-RFC1918: https://wicg.github.io/cors-rfc1918 – Mac, Windows, Linux

#block-insecure-private-network-requests

選項:Default Enabled Disabled

Insecure origins treated as secure

Treat given (insecure) origins as secure origins. Multiple origins can be supplied as a comma-separated list. Origins must have their protocol specified e.g. "http://example.com".

選項: 已禁用                   已啟用

【途徑2】:關閉 “windows defender smartscreen”

edge瀏覽器顯示站點不安全:
1、開啟瀏覽器,點選右上角的三個點。

2、在工作列中點選“設定”。

3、點選左側工作列的“隱私和安全性”。

4、下拉到底,將“windows defender smartscreen”關閉即可。

【途徑3】

使用啟動命令引數:

edge.exe --user-data-dir=/test/only/profile/dir --unsafely-treat-insecure-origin-as-secure="http://example.com"

其它設定

Chrome設定--disable-web-security解決跨域問題

IE設定裡的顯示混合內容

預設是提示。安全和不安全內容或混合內容表示某個網頁試圖同時使用安全 (HTTPS/SSL) 和不安全 (HTTP) Web 伺服器連線來顯示元素。這通常在顯示來自不安全的伺服器的影象、橫幅或指令碼的線上商店或金融站點上出現。顯示混合內容的風險在於,不安全網頁或指令碼可能能夠訪問安全內容中的資訊。

windows10/7/8作業系統在組策略中設定IE瀏覽器顯示混合內容。電腦“執行”–“cmd”開啟組策略,或者在c:\windows\system32中找到gpedit.msc檔案開啟即可。

找到對應選項:IE瀏覽器顯示混合內容即可根據自己的需要設定已啟用、已禁用或者未設定。

該策略可以對應生效處理的內容為:

\Windows元件\InternetExplorer\Internet控制面板\安全頁\受信任的站點區域。設定成功後,登出計算機重新進入桌面即可生效。

開發人員本地除錯,謹慎操作。

參考:Secure Contexts (w3c.github.io):https://w3c.github.io/webappsec-secure-contexts/​​​​