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?
You can control what location information your phone can use. Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.
gpsd is a GPS service daemon for Linux, OpenBSD and Mac OS X. There's also a Windows version. It can connect to GPS receivers via serial, USB port, Bluetooth, or via another gpsd through the network (TCP/IP connection).
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.
Firefox on linux used to support gpsd.
about:config
geo.gpsd.host.ipaddr
value localhost
geo.gpsd.logging.enabled
value true
However, it seems that the gpsd support has been removed
Chromium seems to have had gpsd support in the past, but I can't find anything about it now. It looks like hardware gps support is not a priority. If this was handled in ChromeOS, it might be possible to use the same mechanism, but I don't see support there either.
In both cases, it should be possible to write an extension to fake the GPS coordinates, which could read from your real GPS.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With