This should have been easier to solve then it was, so I thought I’d post it here for anyone else looking for a way to reset a geolocation prompt in Google Chrome.
Open Location Privacy Settings
Open the Chrome > Preferences > Settings > Privacy > Content settings… > Location panel in Chrome, or copy and paste this URL into your browser:
Remove Hostname Patterns
Then you just remove the hostname patterns that you want to reset:
- Find the site you want to reset under Hostname pattern
- Hover over the site and click the “×” icon that appears on the right hand side of the table row.
That’s it! Hopefully this helps someone else out there reset a geolocation prompt in Google Chrome. This is very useful for testing
navigator.geolocation.getCurrentPosition() usage in Chrome.
Unfortunately it’s not possible to automate though so it can be difficult to work with this and a test runner. If anyone else has a solution that works well with automated testing please post a comment, I’d love to hear about it!
About the Author