简体   繁体   English

Firefox 43似乎打破了W3C(navigator.geolocation)位置服务

[英]Firefox 43 seems to have broken W3C (navigator.geolocation) location services

I've just upgraded to Firefox 43 and the HTML5/W3C location service on my site no longer works. 我刚刚升级到Firefox 43,我网站上的HTML5 / W3C位置服务不再有效。

I've checked the release notes for 43 and can find no reference to any changes. 我已经检查了43的发行说明 ,但没有找到任何更改的参考。

This is the JS that I'm using to get the current Lat/Long location: 这是我用来获取当前Lat / Long位置的JS:

// Try W3C Geolocation (Preferred)
if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function (position) { // start of callback function for success
    alert("ok");
    }, 
    function () {  // start of callback function for getPos failure
                alert("Unable to determine your current location");
    }); // end of get position call
} else { // Browser doesn't support Geolocation
     alert("Geolocation not available");
}

and here is a JSFiddle showing that in Firefox 43 I get the 'unable to determine' error, rather than geolocation not available... 这是一个JSFiddle,显示在Firefox 43中我得到'无法确定'错误,而不是地理定位不可用...

Note, geolocation still seems to be working in Chrome with the above, and Firefox 43 on Android is still working without problems. 请注意,地理定位似乎仍然在Chrome中使用,并且Android上的Firefox 43仍然可以正常工作。

A bit strange... 有点奇怪......

With the download of the v43.0.1 update this problem resolved itself before the update was applied! 通过下载v43.0.1更新,此问题在应用更新之前自行解决!

There is no mention in the 43.0.1 release notes of any change that would affect geolocation either, but the problem has definitely resolved. 在43.0.1发行说明中没有提及任何会影响地理定位的变化,但问题肯定已经解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM