Why do Chrome and Safari ask for location permission twice on iOS?

Viewed 608

I have this problem where the browser is asking for the same geolocation permission twice. If I accept the permission, and then refresh, the browser asks for the permission again. Why is that? (If I refresh again, the permission is remembered.)

This happens to me on both Chrome and Safari on iOS 10, 11, and 12.

There is a simple test case at the following URL: https://nameless-bastion-75811.herokuapp.com

The code is below:

<html>
 <head>
  <title>Geolocation test</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
 </head>
 <body>
  <script>
   document.write('About to ask for geolocation…')

   navigator.geolocation.getCurrentPosition(function success(position){
    document.write('position is ' + position.coords.latitude + ',' + position.coords.longitude)
   }, function error(error){
    document.write('error: ' + error.code + ' - ' + error.message)
   })
  </script>
 </body>
</html>

0 Answers
Related