How can the browser tell where I am?
Totally based on registered IP address? What if I'm behind a proxy?
HTML5 Geolocation API lets you share your location with your favorite web sites. A JavaScript can capture your latitude and longitude and can be sent to backend web server and do fancy location-aware things like finding local businesses or showing your location on a map. var geolocation = navigator.
Since devices are used by individuals, geolocation uses positioning systems to track an individual's whereabouts down to latitude and longitude coordinates, or more practically, a physical address. Both mobile and desktop devices can use geolocation.
The Geolocation API is accessed via a call to navigator. geolocation ; this will cause the user's browser to ask them for permission to access their location data. If they accept, then the browser will use the best available functionality on the device to access this information (for example, GPS).
That would depend on the browser and its settings. It might use GPS, WLAN AP-based location, IP location, or any other conceivable method of locating itself.
The browser runs on your local machine, so even if you're behind a proxy, it should be able to find your actual IP address (unless security features prevent it from being sent for lookup to a geolocation server). Whether any browser is smart enough to handle being behind a NAT (with the local machine having a private IP) and looking up the gateway's IP address, that I don't know.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With