Firefox 11 and GeoLocation denial callback

落爺英雄遲暮 提交于 2019-12-01 04:05:09

问题


Things worked okay is Firefox 10.x but with the upgrade to Firefox 11 has thrown up a problem.

I use

navigator.geolocation.getCurrentPosition(success, failure)

but in FF11 the failure callback is not executed when the user denies sharing location by selecting "Not Now".

Any suggestions?


回答1:


Okay, so the answer for now is: "Not possible, Firefox by design will not fire the failure event. Build your app around this constraint."




回答2:


Actually you get the error callback in Firefox ONLY if you click Never share location.

Because when you click Not now (or just close the popup), you can still click the location icon in address bar and allow it later.

(tested on FF28)

edit: here is a demo of how to detect location with special note for Firefox.



来源:https://stackoverflow.com/questions/9769409/firefox-11-and-geolocation-denial-callback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!