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

Geolocation "timeout" #54

Open
pasqualepalmaccio opened this issue Apr 17, 2018 · 10 comments
Open

Geolocation "timeout" #54

pasqualepalmaccio opened this issue Apr 17, 2018 · 10 comments

Comments

@pasqualepalmaccio
Copy link

Hi,
when i try "geolocator.locate " function returns often "timeout" . First time works perfectly but if i reload function i get timeout.
Also on your site if you click on locate button you will get timeout of geolocator. How can i solve this?

Best regards

@onury
Copy link
Owner

onury commented Apr 18, 2018

Hi. Yes, this is really strange. This seems to happen only on Chrome. Is that the case for you too? Did you check it on Firefox or others?

I also found out that if you wait for at least 1 minute, between calls, it does not timeout; otherwise it will timeout everytime (after first) until 1 minute is passed.

This is not related with Geolocator.js, it seems. Pls try this page https://browserleaks.com/geo and see if it happens there too using Chrome.

— Seems to happen at least on Chrome v65.x

@silverbux
Copy link

hi @onury is the 1 minute limit applies per user? i mean one user will be able to use the "geolocator.locate " per minute?

thanks in advance

@onury
Copy link
Owner

onury commented Apr 21, 2018

@silverbux hi. This is either a bug or Chrome does it intentionally.
But I couldn't find any official acknowledgement about this yet.

geolocator.locate() internally invokes the HTML5 Geolocation API.
In my tests, I found that Chrome browser seems to limit Geolocation API calls to 1 call per minute, per page. Any more calls than that, on the same page, will timeout.

Can you also confirm whether this is the case for you?
Pls also test https://browserleaks.com/geo multiple times within a minute to see if it happens on that page too, using Chrome and maybe other browsers.

Thanks.

@pasqualepalmaccio
Copy link
Author

pasqualepalmaccio commented Apr 21, 2018 via email

@onury
Copy link
Owner

onury commented Apr 22, 2018

@pasqualepalmaccio Can you confirm -

  • that you've tested both geolocator.js and given site on same Chrome browser? version?
  • that geolocator.js produces the same error on Firefox? or browsers other than Chrome?

Bec. Geolocation API is actually broken in Chrome, as noted in this article and in chromium issue tracker. A similar bug (#820945) is officially confirmed on March 14th and said to be fixed; but not yet released.

Besides, I definitely cannot reproduce this on Firefox or Safari. But only on Chrome v65.
Running this simple code multiple times, even produces the error on Chrome.
(This is not geolocator.js but HTML5 API directly):

navigator.geolocation.getCurrentPosition((a) => console.log(a), (e) => console.log(e), { maximumAge: 10, timeout: 10000, enableHighAccuracy: true });

@pasqualepalmaccio
Copy link
Author

pasqualepalmaccio commented Apr 22, 2018 via email

@mmolimpa
Copy link

Gblk toolkit

@isocroft
Copy link

Any progress details on this ?

@ivanoats
Copy link

I am seeing this issue on Firefox 65.0.1 on Mac OS 10.14.3

I have checked browserleaks.com/geo and it works fine on that site in Firefox.

@mucill
Copy link

mucill commented Jun 29, 2019

Hi,
I've still got the same issue in Chrome/FF. At the first time running, it was fine.
After that, No Response or Timeout. My friend said it must be run in https, but still the same. Even I set the timeout as 60000. Any help will appreciated. Thank you.

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

7 participants