今天碰到奇怪问题,我们加载网页从http改成https时,网页中的图片都无法加载。报错如下:
“Mixed Content: The page at ‘https://…’ was loaded over HTTPS,
but requested an insecure image ‘http://image…..jpg‘.
This content should also be served over HTTPS.”
原因:webview 从Lollipop(5.0)开始 webview默认不允许混合模式,https当中不能加载http资源,如果要加载,需单独设置开启。
解决方案:
Android webview加载https网页时http图片无法显示
最新推荐文章于 2024-08-15 04:09:27 发布