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

前端 未结 3 461
耶瑟儿~
耶瑟儿~ 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:01

    Chromium 52 has it in-built:

    1. Open developer console
    2. Click the : button on the right, select More tools -> Sensors
    3. In Tab "Sensors" you can modify the current location:

    0 讨论(0)
  • 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.
    0 讨论(0)
  • 2021-01-13 16:16

    I am a bit late, but Microsoft Edge has this useful tab Emulation.

    You can open this developer tool as usual hitting F12 button or by clicking on the browser's menu button, Developer Tools F12.

    Geolocation: Simulate a GPS receiver and enter GPS coordinates to test location-aware features in a webpage.

    More info here at developer.microsoft.com

    0 讨论(0)
提交回复
热议问题