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?
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:
about:config
geo.location.use_gpsd
value true
Prior to Firefox 23, you had to:
geo.gpsd.host.ipaddr
value localhost
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.