It does this through the HTML5 Geolocation API , which is now supported by most modern browsers. Of course, it is for the implementation of the browser that the interface must decide how to determine the location. A cell phone will be very different from a desktop machine, etc. For example, Firefox uses the Google web service to do this based on IP, while Mobile Safari will use Core Location.
A quick Google search will contain a lot of information on how to discover and take advantage of opportunities.
source share