我在Firefox和Safari中都收到控制台错误:
ERROR(1): User denied geolocation prompt
致电navigator.geolocation.getCurrentPosition()
我已经做了一个非常简单的Geolocation演示,就像这里的示例:https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition#Example
这是 https 安全,然后单击允许位置访问。
这是演示:https://demo.footstepsmarketing.com/locator.html
它可以在Chrome中使用。我可以确认它确实可以在Firefox 63中使用,但不能在64以上版本中使用。在Safari中不起作用。任何见解将不胜感激,谢谢!
答案 0 :(得分:0)
好像他们在新版本中对其进行了修复,面临着相同的问题:
https://www.ghacks.net/2019/03/01/firefox-65-0-2-fixes-a-geolocation-issue/