我在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中不起作用。非常感谢任何见解,谢谢!
看起来他们在新版本中修复它,面临同样的问题:
https://www.ghacks.net/2019/03/01/firefox-65-0-2-fixes-a-geolocation-issue/