Search code examples
google-chromefirefoxgpsgeolocationgpsd

GeoLocation from gpsd


The gpsd program lets linux users cleanly organize their GPS peripheral data, such that a command line program like cgps or a graphical one like xgps can read the data, and write to a socket, like /var/run/gpsd.sock.

There's a nice tutorial on the net for rigging a raspberry pi to use this data. This is all well and good, but how can I integrate this data in firefox or chromium, as the geolocation API? Is there a specific build process I might need? For instance, setting a ./configure flag or something? Is there a way to integrate this data in a prebuilt version of either browser?


Solution

  • Firefox on Linux supports gpsd - it was added in Firefox 4, removed in Firefox 23 and added back in Firefox 50.

    However, it still needs to be enabled during build, with --enable-gpsd (which seems not to be the case yet in Ubuntu) and in the configuration, by following these steps:

    1. Navigate to about:config
    2. Create a new string preference, name geo.location.use_gpsd value true

    Prior to Firefox 23, you had to:

    1. Create a new string preference, name geo.gpsd.host.ipaddr value localhost
    2. Create a new boolean value, name geo.gpsd.logging.enabled value true

    Google Chrome had gpds support added in November 2011 and removed in October 2013. It looks like hardware GPS support is not a priority. If this was handled in Chrome OS, it might be possible to use the same mechanism, but I don't see support there either.

    Someone built an extension which attempts to provide support in recent versions, requiring to install a script system-side.