Chrome has blocked my geolocation tracking

Viewed 4395

I am developing a webpage using "geolocation" and for that I need to allow access and deny access many times a day just to see how it works with my code. Here is just a code example.

<script>
    if (navigator.geolocation) {
                navigator.geolocation.getCurrentPosition(showPosition);
/*        navigator.geolocation.getCurrentPosition(showPosition, showError);*/
    } else { 
        alert("Geolocation is not supported by this browser.")
    }
</script>

All of a sudden It always denies tracing my location and when I click the trace icon it says

"The following sites have been blocked from tracking your location on this page <my page name>" 

And below it says

"Settings will be cleared on next reload"

I've tried to reload the page, I've tried to restart Google Chrome, I've entered in the location settings but the block list is empty so I can't find my page there either.

So what can I do? I can't continue to develop my page as long as my page is permanently blocked.

3 Answers

TL;DR: Settings > Clear Browsing Data > Advanced > check 'Hosted App Data' > Clear Data

Walkthrough:

  1. In Chrome, click the menu button and then 'Settings' (or just visit 'chrome://settings/').
  2. In Settings, start typing 'clear browsing data' into the search bar and select 'Clear browsing data' under 'Privacy and Security' when it appears.
  3. In the 'Clear Browsing Data' pop-up, click on the 'Advanced' tab.
  4. Set time range to 'Last hour' (or longer depending on when you think Chrome began to block geolocation).
  5. Check the 'Hosted app data' checkbox (it should be at the bottom of the list), and deselect all of the other checkboxes.
  6. Click 'Clear Data'.
  7. Go back to the page which is trying to request geolocation. The geolocation permission dialogue should appear next time you attempt to trigger it.

Further note:

For development work, you can override geolocation in Chrome DevTools. See the following article for instructions: https://developers.google.com/web/tools/chrome-devtools/device-mode/geolocation

try using microsoft edge than google chrome i use microsoft edge just to test my current browser location on localhost

> Open the Google Chrome app. Touch the Chrome menu . Touch Settings >
> Site settings > Location. Use the switch to either have Chrome ask
> before accessing your location, or to block all sites from accessing
> your location. Touch the specific blocked or allowed sites to manage
> exceptions.
Related