Faking geolocation in Chrome
I finally found a good extension for controlling browser geolocation: location-guard. It’s open source, works in multiple browsers, and has some smart features. This replaces my old config hack for Firefox on my desktop computer and I’m mostly using it to work around Starlink’s geolocation limitations.
Update July 2025: no one ported Location Guard to MV3 so Google has now broken it. I’m using Cloaq instead. It’s not quite as fancy but seems to do the job. However read the notes about their use of the debugger API and having to launch Chrome with a shortcut. Nuisance!
Update April 2026: I’m using this Location Guard (V3) now. It’s on GitHub here but I didn’t verify that the version from the Chrome web store matches that code.
I used this site to test it (although it bugged out on me once...) Probably this test site is better, it has more diagnostic detail. The Chrome permissions at chrome://settings/content/location are also worth examining.
It’s important to me this type of extension be open source. The extension has to have permission to access all websites and all data, so it takes a lot of trust to run it. And this kind of extension has a bad history of being bought and subverted (see also: the sad Hover Zoom story.)
Location Guard works by overriding the geolocation API in the browser Javascript. It’s pretty clever about it. By default Location Guard adds 500 meters of random noise to your current location. It keeps a cache of the location it gives to the site for 30 minutes so you don’t appear to be jumping around randomly. It also updates the accuracy data on the reply to indicate the location is not precise.
I worry that this kind of randomization is not really great, that if a site collects enough samples they can average away the noise. I’ve always thought it was better to just truncate coordinates. But in practice it’s probably good enough for most sites. Also I could be entirely wrong about this, the FAQ references some academic research about why this particular kind of Laplacian noise works.
But I won’t want to fuzz my location, I want to appear 400 miles away. For that I use Fixed Location. There’s a confusing option to that: “Fixed location disables geolocation. warning: this also disables the permission dialog”. I’m running with that turned off, because I definitely want to get a notification if a site is trying to geolocate me. The relevant code is here. It seems to work to let you still deny location permission if you want.
Note if you’re testing this be sure to use the extension option to delete local cache as needed.