Tìm kiếm hỗ trợ

Tránh các lừa đảo về hỗ trợ. Chúng tôi sẽ không bao giờ yêu cầu bạn gọi hoặc nhắn tin đến số điện thoại hoặc chia sẻ thông tin cá nhân. Vui lòng báo cáo hoạt động đáng ngờ bằng cách sử dụng tùy chọn "Báo cáo lạm dụng".

Learn More

The geolocation method is not working in browser.

  • 8 trả lời
  • 1 gặp vấn đề này
  • 3 lượt xem
  • Trả lời mới nhất được viết bởi cor-el

more options

The geo-location method is not working in browser. I have also tried the documentation approach on developer.mozilla but not working .Please refer this " https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API"

The geo-location method is not working in browser. I have also tried the documentation approach on developer.mozilla but not working .Please refer this " https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API"
Đính kèm ảnh chụp màn hình

Được chỉnh sửa bởi anubhav.garg vào

Tất cả các câu trả lời (8)

more options

your refer link is about websites. you ask that the geo-location is not working in your browser.

First see in your browser options: Options

more options

As per the refer link and attached screenshot the location functionality is not working in the Mozilla browser and I already check all the browser options for geo-locations but do not work.

more options

Did you allow the website to access your location ?

The screenshot shows the geo-sharing-icon that looks like a cross next to the padlock icon on the location bar. If you click this icon then you can select whether Geo Location is enabled for this website.

  • chrome URI of this icon: chrome://browser/skin/notification-icons/geo.svg

What do you see if you paste navigator.geolocation in the Web Console (best to do this is on a page with a secure https:// connection).

more options

I already enabled the Geo Location in the browser and in the console after running the navigator.geolocation it gives undefined.

more options

Here is the navigator geolocation function result in both chrome and mozilla browser console.

more options

hi, it's probably the same issue as in https://bugzilla.mozilla.org/show_bug.cgi?id=1610306 - geolocation is working in firefox builds that are directly provided by mozilla (like snap packages or directly from their homepage), not the ones that are coming from ubuntu....

more options

This works for me in Firefox. I need to confirm to access the location via the geo location icon doorhanger to get the output.

Are you getting the confirmation dialog?

See also "Tools -> Page Info -> Permissions".


navigator.geolocation.getCurrentPosition(function(loc){
  console.log('Your current position is:');
  console.log(`Latitude : ${loc.coords.latitude}`);
  console.log(`Longitude: ${loc.coords.longitude}`);
  console.log(`More or less ${loc.coords.accuracy} meters.`);
});
more options

I had missed that you aren't using Firefox from the Mozilla server.

I assume that API keys aren't included in your Ubuntu Firefox version, see about:support (Help -> Troubleshooting Information).