Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Geolocation doesn't work if Google Location Accuracy is disabled #3048

Open
danpla opened this issue Apr 8, 2023 · 1 comment
Open

Comments

@danpla
Copy link

danpla commented Apr 8, 2023

Describe the bug

Geolocation doesn't work if Google Location Accuracy is disabled. This is basically a continuation of #1658 , which does not recieve any feedback from the developers.

How to Reproduce

  1. Go to the system location settings and disable "Google Location Accuracy" (on Android 10 it can be found under the Advanced section.
  2. Go to maps.google.com and choose "Your location"

Expected behavior

It should work.

Environment

- DDG App Version: 5.154
- OS: Android 10
@dryaz
Copy link

dryaz commented Jun 3, 2023

Seems like it depends on webkit location impl and how it's done on web.

Here's a bit modified https://www.w3schools.com/html/tryit.asp?filename=tryhtml5_geolocation

<!DOCTYPE html>
<html>
<body>

<p>Click the button to get your coordinates.</p>

<button onclick="getLocation()">Try It</button>

<p id="demo"></p>

<script>
var x = document.getElementById("demo");

function getLocation() {
  if (navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(showPosition, error);
    x.innerHTML = "Loading";
  } else { 
    x.innerHTML = "Geolocation is not supported by this browser.";
  }
}

function showPosition(position) {
  x.innerHTML = "Latitude: " + position.coords.latitude + 
  "<br>Longitude: " + position.coords.longitude;
}

function error(err) {
  x.innerHTML = err.message;
}
</script>

</body>
</html>

In case of improved location turned off getCurrentPosition won't ever be finished. It happens in DDG, chromium (not Chrome) and other custom implemnetation based on webview as well.

Same flow works in Chrome and Firefox which uses Gecko inside.

Chrome also has some specific behavior since it's a google product. E.g. after fresh install it won't even ask location permission neither for app nor for site itself. For other web maps (e.g. komoot, yandex it will ask additional permission).

So this is not DDG bug but an overall webkit based implementations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants