chrome浏览器无法下载http链接的资源

现象:

通过HTTPS页面无法下载http资源,并且Console中打印如下信息.

Mixed Content:The Site at https:...was loaded over a secure connection,but the file at http:... was redirected throug an insecure connection.This file should be served over HTTPS.This download has been blocked.See https://blog.chromium.org/2020/02/protecting-users-from-insecure.html for more details.

原因:

该现象是由于Chrome浏览器为保证用户隐私与安全,设置的安全保证,Chrome的改造进程如下:

即Chrome版本85之后禁用可执行性文件(exe,apk等)的下载,Chrome81与83仍然支持下载但在控制台会有⚠️警告.

如何禁用(不建议):

    地址栏输入
chrome://flags/
    搜索: Treat risky downloads over insecure connections as active mixed content; 将右侧默认的Default修改为Disable

如上图描述该功能是不允许从安全的页面下载非安全资源.如果禁用可能会对用户安全和隐私形成安全隐患.

    修改后按照提示重启浏览器即可生效.
经验分享 程序员 微信小程序 职场和发展