Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

305
Vistas
The website is asking for a permission to access location, whereas the location access is in client side

Let us consider this javascript code:

if (navigator.geolocation){
  navigator.geolocation.getCurrentPosition(function(position) {
    document.getElementById('id111').innerHTML="latitude: " + position.coords.latitude + "<br>longitude: " + position.coords.longitude;
  });
}

It first checks if the navigator.geolocation object is available, and if so, and write the user's coordinates in the HTML element with the id equal to id111.

And in order to do that, the website that contains this code will ask the user for permission to access his own location.

enter image description here

The question is, why the user's permission is needed here, whereas the code is client-side so the website will not actually access the user's location but it is just printed on the user browser?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

The code might be running client side, but it provided by whatever website the user happens to be visiting.

Once that code has the location there is nothing stopping it from, for example, making an Ajax request to send it to a server.

about 4 years ago · Juan Pablo Isaza Denunciar

0

The question is, why the user's permission is needed here

Because you're asking for private information. Some users may not want you to know their physical location, and may choose not to share it. The browser geolocation API standards enforce this.

the website will not actually access the user's location

Sure it will. That's exactly what it's asking for permission to do. Even though your code is running in the user's browser, it's still your code and the user can choose what your code is or is not allowed to access on their computer/device.

but it is just printed on the user browser

The browser doesn't know or care if that's the case. The browser isn't concerned with what you do with the user's private information, only that you get the user's permission before accessing that private information. You can display it on the screen, send it to the server, etc. But first you need the user's permission.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda