getCurrentPosition() and watchPosition() are deprecated on insecure origins(getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用)
问题描述
我在我的网站上收到此错误,该错误要求用户提供地理位置数据:
I am getting this error on my website which requests Geolocation data from the user:
getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用,并且支持将在未来被删除.您应该考虑将应用程序切换到安全源,例如 HTTPS.请参阅 goo.gl/rStTGz 了解更多详情.
getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should consider switching your application to a secure origin, such as HTTPS. See goo.gl/rStTGz for more details.
我的意思是它基本上只是一个通知,谷歌链接只是说它已被弃用.
I mean its basically just a notice, and the google link just says its being deprecated.
我没有将我的网站迁移到 SSL 的计划...那么像我这样的人有其他选择吗?
I have no plans on moving my website to SSL... so is there an alternative for someone like me?
推荐答案
在/jstillwell 的帖子中找到了可能的答案:https://github.com/stefanocudini/leaflet-gps/issues/15基本上将来不会支持此功能(仅在 Chrome 中?),但仅适用于 HTTP 站点.HTTPS 仍然可以,并且没有计划为 HTTP 使用创建等效替代品.
Found a likely answer in /jstillwell's posts here: https://github.com/stefanocudini/leaflet-gps/issues/15 basically this feature will not be supported (in Chrome only?) in the future, but only for HTTP sites. HTTPS will still be ok, and there are no plans to create an equivalent replacement for HTTP use.
这篇关于getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:getCurrentPosition() 和 watchPosition() 在不安全的来源上被弃用


- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 失败的 Canvas 360 jquery 插件 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01