且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS9 不会从安全页面加载不安全的资源(SSL/HTTPS)

更新时间:2021-11-24 21:19:52

这与 ATS 无关.WebKit 强制执行混合内容策略,当通过 https 提供主机页面时,禁止通过不安全的连接加载对某些类别的活动"内容(JS、CSS 等)的访问.

This is not related to ATS. WebKit enforces a mixed content policy that disallows access to certain classes of "active" content (JS, CSS, etc) from being loaded over an insecure connection when the host page is being served over https.

如果您在 Inspector 中检查您的页面,您将在错误面板中看到此报告.

If you examine your page in the Inspector you will see this being reported in the error panel.

跟进:您无法关闭混合内容阻止功能.允许不安全的 CSS 或 JS 会将整个页面的安全性降低到最不安全的资源.如果必须通过 http 加载 css/js,解决方案是通过 http 加载整个页面.这样,用户看到的 UI 就能正确反映内容的安全性.

Follow up: You can't turn off mixed content blocking. Allowing insecure CSS or JS reduces the security of the entire page to that of the least secure resource. The solution if you must load css/js over http is to load the entire page over http. That way the UI seen by the user correctly reflects the security of the content.