Geolocation in Safari 5

后端 未结 5 1170
别那么骄傲
别那么骄傲 2020-12-06 05:43

I have a application which reports my location using HTML5 geolocation. The application works correct on Firefox and Chrome, but on Safari 5, it says that Safari does not su

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 06:20

    Looks like Safari geolocation only works when connected with wifi. When connected with a wired connection Safari calls the error callback from the geolocation functions.

    To test this, try this in the web console:

    navigator.geolocation.getCurrentPosition(
      function(){console.log("success")},
      function(){console.log("error")}
    );
    

    With Safari/wifi this returns 'success' after a second or two, but on a wired connection it returns 'error' immediately.

    ( using Safari 5.1 - 8.x / Mac OSX 10.7 - 10.10 )

提交回复
热议问题