测试是否已授予 html5 地理定位权限

Test if html5 geolocation permission already has been granted(测试是否已授予 html5 地理定位权限)
本文介绍了测试是否已授予 html5 地理定位权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

有谁知道是否有办法测试是否已授予先前的 html5 地理定位权限?

Does anyone know if there is a way to test if prior html5 geolocation permission has been granted?

我尝试制作一个不请求地理位置的脚本,除非该页面已获得许可.不一定非得是 html5;其他框架也可以.

I try to make a script that does not request the geolocation unless the permission for the page has already been given. Does not nessicerily have to be html5; other frameworks are also ok.

推荐答案

根据Geolocation API Specification没有任何功能.甚至将其保存在浏览器首选项中的选项也不会推送到您的代码中.

According to the Geolocation API Specification there isn't any function for this. Even the option to save it in the browser preferences isn't pushed to your code.

如果它真的很重要并且你真的必须意识到这一点,你必须为每个常见的浏览器编写一个浏览器插件并要求用户安装它.但我不会怀疑.

If it's realy important and you realy have to beeing aware of this, you have to write a browser addon for every common browser and ask the user to install it. But i wouldn't doubt of it.

这篇关于测试是否已授予 html5 地理定位权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

SCRIPT5: Access is denied in IE9 on xmlhttprequest(SCRIPT5:在 IE9 中对 xmlhttprequest 的访问被拒绝)
XMLHttpRequest module not defined/found(XMLHttpRequest 模块未定义/未找到)
Show a progress bar for downloading files using XHR2/AJAX(显示使用 XHR2/AJAX 下载文件的进度条)
How can I open a JSON file in JavaScript without jQuery?(如何在没有 jQuery 的情况下在 JavaScript 中打开 JSON 文件?)
quot;Origin null is not allowed by Access-Control-Allow-Originquot; in Chrome. Why?(“Access-Control-Allow-Origin 不允许 Origin null在铬.为什么?)
How to get response url in XMLHttpRequest?(如何在 XMLHttpRequest 中获取响应 url?)