JavaScript
Article

HTML5 Browser Geolocation Browser Support

By Sam Deering

So today in my spare time I wanted to see how different browsers behave with HTML Geolocation and Google Maps. So far, I have done the following browsers: Firefox 16, Chrome 23, IE9, IE8 and Safari 5 for Windows. It is supported by the modern browsers. Here are the results. For the record, I am near Brisbane, Australia.

support

Currently the W3C Geolocation API is supported by the following desktop browsers:

  • Firefox 3.5+
  • Chrome 5.0+
  • Safari 5.0+
  • Opera 10.60+
  • Internet Explorer 9.0+

Test your current browser View Project on GitHub

Firefox HTML5 Geolocation

ff1

ff

Chrome HTML5 Geolocation

chrome

IE9 HTML5 Geolocation

ie91

ie9

IE8 HTML5 Geolocation

ie8

Safari (windows) HTML5 Geolocation

safari(windows)

Some interesting results, especially IE9 getting the city wrong. I think I’ve seen Russia as the center of a viewport before so no surprises there. IE8 was never going to support this but I thought Safari for windows would. I will test on the Mac soon and post results. If you want to test your browser you can do so below. The geolocation can be used for other things not just plotting a point on a map: see W3c use cases for more examples.

Test your current browser

Full Code Listing

< !DOCTYPE html>

  
    
    
    
    
    
    
  
  
    

Recommended

Learn Coding Online
Learn Web Development

Start learning web development and design for free with SitePoint Premium!

Get the latest in JavaScript, once a week, for free.