[Violation] Only request geolocation information in response to a user gesture.

3,557 views
Skip to first unread message

Scott Beeson

unread,
Dec 2, 2017, 12:09:04 PM12/2/17
to Google Chrome Developer Tools
My team is working on an Augmented Reality app which constantly tracks your location.  I updated to Chrome 64 and now I'm seeing this message repeatedly in my console (verbose).

[Violation] Only request geolocation information in response to a user gesture.

This seems... excessively restrictive. When I'm driving I don't constantly click "update location" in Google Maps and Navigation.  Surely polling for location is acceptable?  What is the alternative?  How can I avoid this message?

Kayce Basques

unread,
Jan 2, 2018, 3:27:25 PM1/2/18
to Google Chrome Developer Tools
I think we talked about this over on Stack Overflow:

https://stackoverflow.com/questions/47581575/only-request-geolocation-information-in-response-to-a-user-gesture/47598837#47598837

The solution is to set a geolocation listener with watchPosition(). The listener fires whenever the location updates.
Reply all
Reply to author
Forward
0 new messages