是否有任何允许模拟地理位置的浏览器(Chrome、Firefox)插件​​? [英] Is there any browser (Chrome, Firefox) plugin that allows to simulate geo location?

查看:35
本文介绍了是否有任何允许模拟地理位置的浏览器(Chrome、Firefox)插件​​?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要测试广泛使用地理位置 API(getCurrentPosition、watchPosition)的 Web 应用程序.是否有任何允许模拟地理位置的浏览器(Chrome、Firefox)插件​​?

I need to test web application that extensively uses geo location api (getCurrentPosition, watchPosition). Is there any browser (Chrome, Firefox) plugin that allows to simulate geo location?

推荐答案

如果我正确理解了这个问题,并且您正在寻求一种方法来为您的 Web 应用程序伪造地理定位响应,您可以在 Firefox 中通过以下方式执行此操作覆盖首选项中的 geo.wifi.uri,就像 Firefox 的单元测试一样.见:

If I understood the question correctly and you're asking for a way to fake geolocation responses for your web app, you might be able to do this in Firefox by overriding the geo.wifi.uri in the prefs, like Firefox's unit tests do. See:

  • http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/geolocation/geolocation_common.js?force=1
  • http://mxr.mozilla.org/mozilla-central/source/dom/tests/mochitest/geolocation/network_geolocation.sjs?force=1 - the httpd.js script responding to requests of the geo.wifi.uri used in the tests.

这篇关于是否有任何允许模拟地理位置的浏览器(Chrome、Firefox)插件​​?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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