admin管理员组文章数量:1429568
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.
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.
Share Improve this question asked Sep 22, 2017 at 10:20 Joey_DJoey_D 1171 silver badge7 bronze badges 3- 4 try removing auto fill form data and hosted app data from cache. Basically if you clicked once not to use the geolocation, it will capture it till the end. If that won't work then we need to find another issue. – Dhaval Jardosh Commented Sep 22, 2017 at 11:03
- 6 Had the same issue which was driving me insane. What eventually fixed it was clearing hosted app data as Dhaval Jardosh suggested. Settings -> Advanced -> Clear Browsing Data -> Hosted App Data. – user3333134 Commented Nov 15, 2017 at 18:46
- ok but when someone blocks my page to access his location and then decides to allow, will he have to go through all this steps to allow? for most people - not developers, just site visitors - is this too plicated I think. Any ideas? @user3333134 – Meir Commented Jun 3, 2020 at 19:53
3 Answers
Reset to default 1TL;DR: Settings > Clear Browsing Data > Advanced > check 'Hosted App Data' > Clear Data
Walkthrough:
- In Chrome, click the menu button and then 'Settings' (or just visit 'chrome://settings/').
- In Settings, start typing 'clear browsing data' into the search bar and select 'Clear browsing data' under 'Privacy and Security' when it appears.
- In the 'Clear Browsing Data' pop-up, click on the 'Advanced' tab.
- Set time range to 'Last hour' (or longer depending on when you think Chrome began to block geolocation).
- Check the 'Hosted app data' checkbox (it should be at the bottom of the list), and deselect all of the other checkboxes.
- Click 'Clear Data'.
- 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./web/tools/chrome-devtools/device-mode/geolocation
> 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.
try using microsoft edge than google chrome i use microsoft edge just to test my current browser location on localhost
本文标签: javascriptChrome has blocked my geolocation trackingStack Overflow
版权声明:本文标题:javascript - Chrome has blocked my geolocation tracking - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745516064a2661545.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论