Geolocation provider for Firefox that allows manual input(允许手动输入的 Firefox 地理定位提供程序)
问题描述
是否有任何简单的方法来覆盖 geolocation api 的默认行为并且只是硬编码你现在的位置?
Are there any easy ways to override the default behaviors of the geolocation api and just hard code your current location?
我认为这对于测试和出于隐私原因(提供虚假位置数据)很有用
I think this would be useful for testing and for privacy reasons (providing fake location data)
我以为有一个附加功能,但我似乎找不到.现在唯一的选择似乎是将 about:config geo.wifi.url 更改为一些替代网络服务,我认为这过于复杂.
I thought there was an add on for this but I can't seem to find one. Only option right now seems to be changing the about:config geo.wifi.url to some alternative webservice, which I consider overly complicated.
有什么想法吗?
谢谢
理想场景
有人实现了一个显示谷歌地图的插件,我可以选择一个新的默认位置.
Somebody implements an add-on where a google map appears and I can pick a new default location.
推荐答案
geo.wifi.uri 不需要是 web 服务.您也可以使用 file://...
The geo.wifi.uri does not need to be a webservice. You can also set it to a local uri with file://...
文件应该是一个json文件,内容如下:
The file should be a json file with content like this:
{"location": {
"latitude": 48.777025000000002,
"longitude": 9.1713909999999998,
"accuracy": 10.0}}
更新:对于 Firefox 9+,格式已更改:
Update: For Firefox 9+, the format has changed:
{
"status": "OK",
"accuracy": 10.0,
"location": {"lat": 48.777, "lng": 9.171}
}
或者您可以将它们结合起来支持两者:
Or you can combine them to support both:
{
"status": "OK",
"accuracy": 10.0,
"location": {
"lat": 48.777,
"lng": 9.171,
"latitude": 48.777,
"longitude": 9.171,
"accuracy": 10.0
}
}
更新:看起来手动设置此首选项被假设为 Google 服务的提供商阻止.请参阅 错误 716453更新 2: geo.wifi.uri 不是 geo.wifi.url
Update: it looks like manually setting this preference is blocked by the provider assuming the Google service. See Bug 716453 Update 2: geo.wifi.uri not geo.wifi.url
这篇关于允许手动输入的 Firefox 地理定位提供程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:允许手动输入的 Firefox 地理定位提供程序


- 失败的 Canvas 360 jquery 插件 2022-01-01
- CSS媒体查询(最大高度)不起作用,但为什么? 2022-01-01
- Fetch API 如何获取响应体? 2022-01-01
- 400或500级别的HTTP响应 2022-01-01
- addEventListener 在 IE 11 中不起作用 2022-01-01
- Flexslider 箭头未正确显示 2022-01-01
- 使用RSelum从网站(报纸档案)中抓取多个网页 2022-09-06
- 如何使用 JSON 格式的 jQuery AJAX 从 .cfm 页面输出查 2022-01-01
- Quasar 2+Apollo:错误:找不到ID为默认的Apollo客户端。如果您在组件设置之外,请使用ProvideApolloClient() 2022-01-01
- Css:将嵌套元素定位在父元素边界之外一点 2022-09-07