Firefox: navigator.geolocation.getCurrentPosition no longer works

In the application, the call navigator.geolocation.getCurrentPosition was used to work in all major browsers. But having recently checked the application, I saw that Firefox just doesnโ€™t work anymore (it still works on Chrome, other browsers are not tested)

There are other questions regarding the same, Molochdaa or noxoc . Both have a violin for demonstration. Both do not work for me (only FF, Chrome is fine).

Since our code has not changed for about six months, is it possible that something happened with Firefox?

code:

if (navigator.geolocation) { navigator.geolocation.getCurrentPosition( onSuccessGeoLocation, onFailGeoLocation, { timeout:10000 }); } else { onFailGeoLocation(); } 

I get an error message: "Geolocation: permission rejected: 1, position not available: 1, timeout: 3". Receiving when you click "Share" in a pop-up window asking whether to share or not.

+4
source share
1 answer

What version of OS / Firefox are you using? I had the same problem with Linux Mint 15 with Firefox 24. I just downgraded to Firefox 20 and it works now. With Windows or Android, I have no problem. This seems to be a Linux / Firefox issue.

0
source

Source: https://habr.com/ru/post/956857/


All Articles