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

326
Vistas
navigator.geolocation.getCurrentPosition not working on a certain browser

I'm having a problem with javascript's:

navigator.geolocation.getCurrentPosition(success_callback,error_callback)

It's working fine on most machines with most browsers..problem is I have a Mac and by default it prevents browsers accessing locations, unless I manually allow it at the OS level. (As a side note I'm using the Brave browser, chrome doesn't have the issue)

What is happening at the moment is that Brave asks for permission to access location. I select yes but because at the OS level it isn't permitted, the success_callback and the error_callback are both not called...thus my site just hangs there.

I should mention, chrome doesn't have this issue, it somehow knows the os is blocking the permission so the error_callback gets called.

My question is how do I over come this? Partial code is below:

<template>
    <Modal v-if="showModal">
</template>

navigator.geolocation.getCurrentPosition(this.setBrowserLocation, this.errorBrowserLocation)

setBrowserLocation(position) {
    ....
    ....
    ....
    this.showModal = true
}

errorBrowserLocation(error) {
    this.showModal = true
}

I'm thinking that I can do something along the lines of checking if neither one of the call_backs is called. And if they are both not called I can auto set this.showModal. I thought of using watchers but they only detect a change...so nothing changes then I can't really use it.

Any ideas of how I can deal with this?

about 4 years ago · Juan Pablo Isaza
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