為了改善您的使用體驗,本網站正在進行維護,部分功能暫時無法使用。若本站的文件無法解決您的問題,想要向社群發問的話,請到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 發問,我們的社群成員將很快會回覆您的疑問。

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

Geolocation not working

  • 3 回覆
  • 1 有這個問題
  • 1 次檢視
  • 最近回覆由 cor-el

more options

Hi,

Geolocation doesn't seem to work on Firefox for me. I can't use Google Maps or other location-based services even after giving permissions.

I found this post: https://support.mozilla.org/en-US/questions/1282004#answer-1297537

I got the following results:

https://browserleaks.com/geo - I get "POSITION_UNAVAILABLE" https://bestvpn.org/html5demos/geo/ - "failed" https://www.iplocation.net/find-ip-address - correctly gives New York, New York, the location of my VPN's proxy

I also copied the following from 'about:config':

Application Basics


Name: Firefox Version: 78.0.1 Build ID: 20200701193652 Distribution ID: archlinux User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 OS: Linux 5.7.7-arch1-1 Multiprocess Windows: 1/1 Enabled by default Remote Processes: 8 Enterprise Policies: Inactive Google Location Service Key: Found Google Safebrowsing Key: Found Mozilla Location Service Key: Found Safe Mode: false

Thanks in advance for your help!

Hi, Geolocation doesn't seem to work on Firefox for me. I can't use Google Maps or other location-based services even after giving permissions. I found this post: https://support.mozilla.org/en-US/questions/1282004#answer-1297537 I got the following results: https://browserleaks.com/geo - I get "POSITION_UNAVAILABLE" https://bestvpn.org/html5demos/geo/ - "failed" https://www.iplocation.net/find-ip-address - correctly gives New York, New York, the location of my VPN's proxy I also copied the following from 'about:config': Application Basics ------------------ Name: Firefox Version: 78.0.1 Build ID: 20200701193652 Distribution ID: archlinux User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 OS: Linux 5.7.7-arch1-1 Multiprocess Windows: 1/1 Enabled by default Remote Processes: 8 Enterprise Policies: Inactive Google Location Service Key: Found Google Safebrowsing Key: Found Mozilla Location Service Key: Found Safe Mode: false Thanks in advance for your help!

被選擇的解決方法

hello

mostlyaspambox...


follow the steps:

I looked into this a little more, and it seems that if Firefox cannot retrieve your nearby wi-fi hotspot names, it should at least send your IP address to get a more approximate location. (Location-Aware Browsing FAQ) The address of this service is listed in about:config (with a missing parameter filled in by the code). You can check here:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(2) In the search box above the list, type or paste geo and pause while the list is filtered

(3) If the geo.wifi.uri preference is bolded and "modified" or "user set", you can right-click > Reset it to the default (mine is https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_API_KEY%)

(4) As an alternative to the default value for geo.wifi.url you can use https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY% (according to Geolocation is still not working !)

If Firefox sends anything to the geolocation service, the address should appear in the Browser Console (you may need to click the "Net" button to un-filter request URLs). For example:

Default address: 08:39:50.874 POST XHR https://www.googleapis.com/geolocation/v1/geolocate [HTTP/2.0 200 OK 343ms]

Alternate address: 08:49:21.994 POST XHR https://location.services.mozilla.com/v1/geolocate [HTTP/1.1 200 OK 920ms]

Tell me its help

thank you!

從原來的回覆中察看解決方案 👍 1

所有回覆 (3)

more options

選擇的解決方法

hello

mostlyaspambox...


follow the steps:

I looked into this a little more, and it seems that if Firefox cannot retrieve your nearby wi-fi hotspot names, it should at least send your IP address to get a more approximate location. (Location-Aware Browsing FAQ) The address of this service is listed in about:config (with a missing parameter filled in by the code). You can check here:

(1) In a new tab, type or paste about:config in the address bar and press Enter/Return. Click the button promising to be careful or accepting the risk.

(2) In the search box above the list, type or paste geo and pause while the list is filtered

(3) If the geo.wifi.uri preference is bolded and "modified" or "user set", you can right-click > Reset it to the default (mine is https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_API_KEY%)

(4) As an alternative to the default value for geo.wifi.url you can use https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY% (according to Geolocation is still not working !)

If Firefox sends anything to the geolocation service, the address should appear in the Browser Console (you may need to click the "Net" button to un-filter request URLs). For example:

Default address: 08:39:50.874 POST XHR https://www.googleapis.com/geolocation/v1/geolocate [HTTP/2.0 200 OK 343ms]

Alternate address: 08:49:21.994 POST XHR https://location.services.mozilla.com/v1/geolocate [HTTP/1.1 200 OK 920ms]

Tell me its help

thank you!

more options

Thanks! Changing to the location.services.mozilla.com URL worked for me. I would just like to note also for anyone else who reads this, the preference I changed was 'geo.provider.network.url'. I didn't have any value for 'geo.wifi.url'.

more options

Note that the MOZILLA_API_KEY isn't included in third-party builds like used when you install Firefox from the repositories.
You can check this via the "Help -> Troubleshooting Information" (about:support) page.
You would have to use Firefox from the Mozilla server.