如何在Chrome 84中加载混合内容图像

问题描述 投票:-1回答:1

这是我的代码的样子:

let image = new Image();
image.src="http://speedtest-nyc1.digitalocean.com/"

它曾经很好用,但是现在我得到了Mixed Content: The page at '' was loaded over HTTPS, but requested an insecure element 'http://speedtest-nyc1.digitalocean.com/'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html

该网站无法通过HTTPS运行,因此请求失败。不幸的是,我不拥有第三方域名,或者可以强迫他们使用HTTPS。我也尝试过AJAX,但它也失败,并出现类似的错误。

我仍然如何向服务器发出请求以保持我的代码正常工作?

google-chrome http content-security-policy web-standards
1个回答
0
投票
http://speedtest-nyc1.digitalocean.com是完整的网站,而不是图像。应该将其加载到iframe中吗?
© www.soinside.com 2019 - 2024. All rights reserved.