我正在开发一个使用" geolocation"为此我需要允许一天多次访问和拒绝访问,只是为了看看它如何与我的代码一起工作。这只是一个代码示例。
<script>
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(showPosition);
/* navigator.geolocation.getCurrentPosition(showPosition, showError);*/
} else {
alert("Geolocation is not supported by this browser.")
}
</script>
突然间它总是拒绝跟踪我的位置,当我点击跟踪图标时它会显示
"The following sites have been blocked from tracking your location on this page <my page name>"
低于它说
"Settings will be cleared on next reload"
我已尝试重新加载页面,我已尝试重新启动Google Chrome,我已进入位置设置,但阻止列表为空,因此无法找到我的那里的页面。
那我该怎么办?只要我的页面被永久封锁,我就无法继续开发我的页面。
答案 0 :(得分:1)
TL; DR:设置>清除浏览数据>高级>选中“托管的应用程序数据”>清除数据
演练:
更多说明:
对于开发工作,您可以在Chrome DevTools中覆盖地理位置。有关说明,请参见以下文章:https://developers.google.com/web/tools/chrome-devtools/device-mode/geolocation
答案 1 :(得分:0)
尝试使用Microsoft Edge而不是Google Chrome,我仅使用Microsoft Edge来测试本地主机上当前浏览器的位置
答案 2 :(得分:0)
public static class DependencyInjectionConfiguration
{
public static void ConfigureDI(IServiceCollection services)
{
services.AddScoped<IReceiver, Receiver>();
services.AddHttpClient<MyClient>();
services.AddScoped<HelperXml>();
//services.AddSingleton<ILoggerFactory, LoggerFactory>();
//services.AddSingleton(typeof(ILogger<>), typeof(Logger<>));
//services.AddLogging(configure => configure.AddConsole());
}
}