Geolocation.getCurrentPosition function does not work in Chrome 50.0

Asked

Viewed 559 times

1

I have a system in JSF that asks the user permission to read its coordinates, this system always worked, but after the last update of Chrome, it stopped working. Someone is going through this with this new version(50.0.2661.75):

<script type="text/javascript">
function getGeo(){
    navigator.geolocation.getCurrentPosition(function(position){
        sendGeo(position.coords);
    },showError);
}
function showError(error) {
    var msgError = "";
    switch(error.code) {
        case error.PERMISSION_DENIED:
            msgError = "Usuário negou o pedido de Geolocalização."
            break;
        case error.POSITION_UNAVAILABLE:
            msgError = "As informações de localização não está disponível."
            break;
        case error.TIMEOUT:
            msgError = "O pedido para obter a localização do usuário expirou."
            break;
        case error.UNKNOWN_ERROR:
            msgError = "Ocorreu um erro desconhecido."
            break;
        default:
            msgError = "-";
            break;
    }
    sendGeo({msgerror:msgError});
}
jQuery( document ).ready(function(){
     if (navigator.geolocation) {
        getGeo();
    } 
});
</script>

I noticed that the browser does not even acknowledge that this site is requesting the location.

  • I have the same problem. I believe the site will have to be accessed by HTTPS, only way to solve.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.