测试html5地理位置权限是否已被授予 [英] Test if html5 geolocation permission already has been granted

查看:217
本文介绍了测试html5地理位置权限是否已被授予的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道是否有方法可以测试之前的html5地理位置权限是否已被授予?

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

我尝试制作不需要地理定位的脚本,除非已经给出了该页面的许可。不要nessicerily必须是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地理位置权限是否已被授予的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆