Is there any browser (Chrome, Firefox) plugin that allows to simulate geo location?

前端 未结 3 463
耶瑟儿~
耶瑟儿~ 2021-01-13 15:24

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

3条回答
  •  执笔经年
    2021-01-13 16:14

    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.

提交回复
热议问题