title: navigator.getCurrentPosition() not working in Firefox nor Safari
body: <p>I can't seem to get navigator.getLocation() working on either Firefox 65 or Safari 10</p>
  
  <pre><code>function getLocation(user_radius) {
  
  var geo_options = {
  enableHighAccuracy: true, 
  maximumAge        : 30000, 
  timeout           : 27000
  };
  
  function error(err) {
  console.warn('Cannot load user location. Make sure you gave permission to share location');
  }
  
  document.body.style.position = "absolute";
  
  if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(function (position) {
  
          lat0 = position.coords.latitude;
          long0 = position.coords.longitude;
          corefunction(user_radius);
      },error,geo_options);
  } else {
      x.innerHTML = "Geolocation is not supported by this browser.";
  }
  }
  </code></pre>
  
  <p>Although Firefox ask to access location while Safari doesn't, neither of them return latitude nor longitude.
  Firefox and Safari log:</p>
  
  <pre><code>*Cannot load user location. Make sure you gave.....*
  </code></pre>
  
  <p>what am I doing wrong?</p>
  
  <p>Yes I gave permissions, and yes I have location services enabled in both.
  The code works fine in Opera, Chrome, IE and Edge...</p>
  
  <p>The curious thing is that I canNOT get my location with those browser even with 3rd party pages:</p>
  
  <p><a href="https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation" rel="nofollow noreferrer">https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation</a>
  <a href="https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API</a></p>
  
  <p>UPDATE#1
  I have tried Steven's suggestion to add navigator.permission;This is the snipplet I ve run just to test if it worked in Firefox.</p>
  
  <pre><code>   function handlePermission() {
    navigator.permissions.query({name:'geolocation'}).then(function(result) {
    if (result.state == 'granted') {
    report(result.state);
    geoBtn.style.display = 'none';
  } else if (result.state == 'prompt') {
    report(result.state);
    geoBtn.style.display = 'none';
    navigator.geolocation.getCurrentPosition(function (position) {
  
          lat0 = position.coords.latitude;
          long0 = position.coords.longitude;
  
      },error,geo_options);
  } else if (result.state == 'denied') {
    report(result.state);
    geoBtn.style.display = 'inline';
  }
  result.onchange = function() {
    report(result.state);
  }
  });
  }
  </code></pre>
  
  <p>The console says "prompt" but getCurrentPosition() is not executed. </p>