Search code examples
javascriptmobilewebgpsgeolocation

Acces mobile GPS data from web site


Can I access the GPS of a mobile from browser but without the user authorization? I am using the html5 Geolocation navigator.geolocation.getCurrentPosition but this needs the user confirmation. Could I access the current user position using javascript but without asking to the authorization user?


Solution

  • No, never. Nor should you even try. That would lead to a huge lack of trust between you and your users. Tracking a user without the user's consent would be a huge invasion of privacy. Feel free to read up on the documentation to learn more.