Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome has blocked my geolocation tracking

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.

like image 988
Joey_D Avatar asked Sep 22 '17 10:09

Joey_D


People also ask

How do I unblock geolocation in Chrome?

Launch the Chrome browser on your Android device. options, and select the Settings menu. Scroll to the Advanced section, and tap on Site Settings. Enable or Disable the Location toggle button to Allow or Block the request.

Why is geolocation not working?

This occurs when the geolocation services fail. For some patrons, this error message may appear if you are using an outdated browser such as Internet Explorer 8. Try installing a new browser (e.g., Firefox) and try again. This occurs when the geolocation services fail.


1 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

like image 179
d_zero Avatar answered Oct 28 '22 07:10

d_zero