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() 在不安全的来源上被弃用


基础教程推荐
- 如何使用TypeScrip将固定承诺数组中的项设置为可选 2022-01-01
- 用于 Twitter 小部件宽度的 HTML/CSS 2022-01-01
- 自定义 XMLHttpRequest.prototype.open 2022-01-01
- 如何使用JIT在顺风css中使用布局变体? 2022-01-01
- 直接将值设置为滑块 2022-01-01
- Chart.js 在线性图表上拖动点 2022-01-01
- Electron 将 Node.js 和 Chromium 上下文结合起来意味着 2022-01-01
- 我可以在浏览器中与Babel一起使用ES模块,而不捆绑我的代码吗? 2022-01-01
- Vue 3 – <过渡>渲染不能动画的非元素根节点 2022-01-01
- html表格如何通过更改悬停边框来突出显示列? 2022-01-01