Chrome浏览器中的CDN库被阻止 [英] CDN library blocked in Chrome

查看:167
本文介绍了Chrome浏览器中的CDN库被阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用传单/OSM绘制站点上的小地图.该站点本身可以​​通过HTTPS访问,而传单库(afaik)只能通过HTTP连接进行检索.现在,Chrome浏览器不包含该库,而是在控制台中向我显示以下消息:

I'm using leaflet/OSM for a small map on a site. The site itself is accessible via HTTPS while the leaflet library can (afaik) only be retrieved via a HTTP connection. Now Chrome doesn't include the library and gives me the following message in the console:

[blocked] The page at https://example.com/foo/bar ran insecure content from http://cdn.leafletjs.com/leaflet-0.5/leaflet.css_

有什么想法我可以解决这个问题吗?

Any idea how I could work around this?

推荐答案

http://cdnjs.com/libraries/leaflet/有传单.他们也有HTTPS版本.

http://cdnjs.com/libraries/leaflet/ has Leaflet. They have HTTPS version as well.

//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css
//cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.js

在代码中使用上述URL.用于加载当前页面的相同协议也将用于获取Leaflet资产.

Use the above URLs in your code. The same protocol used to load the current page will be used to fetch Leaflet assets as well.

这篇关于Chrome浏览器中的CDN库被阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆