Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 support Geolocation.

From what I read, Safari 5 does support Geolocation. What am I missing?

Thanks for your time.

Sunil

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
362 views
Welcome To Ask or Share your Answers For Others

1 Answer

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 )


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...