# What is geolocation API spoofing?

> Geolocation API spoofing makes navigator.geolocation report a chosen position, not the device's own. It holds up only if the position agrees with the IP.

Source: https://mosaicbrowser.com/glossary/geolocation-api-spoofing

## Geolocation API spoofing: what a fake position has to get right

Geolocation API spoofing means making a browser's navigator.geolocation report coordinates you chose instead of the device's real position. Done well, the claimed position sits near the IP address the site sees and answers every request the way a real device would.

![Geolocation API spoofing, drawn as a mosaic of tiles](https://mosaicbrowser.com/covers/geolocation-api-spoofing.webp)

A page asks for your position with `navigator.geolocation.getCurrentPosition()`. The browser shows a permission prompt, and if you allow it, the page gets a latitude, a longitude and an accuracy radius in metres ([W3C Geolocation API](https://www.w3.org/TR/geolocation/)). Spoofing the API changes what comes back. It does not change the prompt, and it does not change your IP.

## How geolocation API spoofing is done

There are three common ways, and they leave different traces.

1. **DevTools.** Chrome's [Sensors panel](https://developer.chrome.com/docs/devtools/sensors) overrides the position for the tab you are inspecting. It is meant for developers testing a store locator, and it disappears when DevTools closes.
2. **A JavaScript override.** An extension replaces `getCurrentPosition` and `watchPosition` with its own functions. A page can often tell: the replaced function no longer prints as native code, and a worker or a fresh iframe may still see the original.
3. **Inside the browser.** The engine itself answers with the claimed coordinates, through the same code path a real location provider uses, so every frame sees the same thing and nothing in JavaScript has been touched.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: Matched to the proxy’s IP](https://mosaicbrowser.com/features/exit-matching)

## What a site checks

The first comparison is the IP. A site already knows roughly where your address is, so coordinates in Lisbon from an IP in Frankfurt are a contradiction in one subtraction. The timezone is the second: `Intl.DateTimeFormat().resolvedOptions().timeZone` should belong to the same place. Our [timezone and IP checker](https://mosaicbrowser.com/tools/timezone-ip-checker) runs that comparison in your own browser.

The third check is behaviour, and it is the one most spoofs miss. A real device answers every call. [`getCurrentPosition`](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) returns a fix each time it is asked, and `watchPosition` keeps a callback alive. When something is wrong, the page gets one of three [error codes](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPositionError): 1 for permission denied, 2 for position unavailable, 3 for timeout. A browser that refuses location is ordinary. A browser that answers once and then times out on every later call is not something any real device does, and a page can read it by asking twice.

## We shipped the "answers once" bug ourselves

Our engine claims a position inside the browser itself. In October 2026 geolocation was reported to us as missing. Measured on a profile behind a Lisbon IP, the first call answered `38.73076,-9.36132`, close to the IP's own `38.6875,-9.3151`. The second call timed out with code 3, and so did every call after it.

The cause was a latch. After delivering a fix, the engine set a flag so that a watch would not ask itself for a new position in an endless loop. Nothing ever cleared that flag, so a fresh `getCurrentPosition` was treated like the watch's own re-query. The fix clears it whenever a new request starts. Five consecutive reads now all answer, and a standing watch delivers one update and then stays quiet, as a phone that has not moved does. A check, `check:geolocation`, holds all four behaviours, and it was seen to fail with the fault put back. Every manual test is a first call, which is why the bug survived.

![Creating a profile in Mosaic: a checked proxy, and the hardware and locale drawn to match its IP](https://mosaicbrowser.com/shots/profile-editor.png)
*Geolocation is drawn for the proxy's measured IP*

## How Mosaic handles geolocation

Each profile has one of three modes. The default, `Match exit` in the app, follows the proxy: it takes the coordinates of the proxy's measured IP and moves them by up to 0.05 degrees, about 5 km, so no two profiles share a point and none reports your computer's real position. **Manual** takes coordinates you enter. **Block** denies the permission, which is what a page sees after somebody clicks Block, with `navigator.geolocation` still present.

There used to be a fourth mode, "Real", that reported the machine's own position. We removed it: in an anti-detect browser it is the one outcome the product exists to prevent. The position is one value in the profile's [browser fingerprint](https://mosaicbrowser.com/glossary/browser-fingerprinting). It is set inside the engine, Tesseract Chrome, and before every launch it follows the IP again with the timezone, so a sticky session that moved cities does not leave the profile behind ([IP matching](https://mosaicbrowser.com/features/exit-matching) has the rules for what moves and what stays). If the timezone and the IP already disagree, [the timezone guide](https://mosaicbrowser.com/guides/browser-timezone-does-not-match-ip) walks through the fix by hand.

## Sources

1. [W3C: Geolocation API](https://www.w3.org/TR/geolocation/), read November 2, 2026
2. [MDN: Geolocation.getCurrentPosition()](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition), read November 2, 2026
3. [MDN: GeolocationPositionError](https://developer.mozilla.org/en-US/docs/Web/API/GeolocationPositionError), read November 2, 2026
4. [Chrome DevTools: Sensors](https://developer.chrome.com/docs/devtools/sensors), read November 2, 2026

## Questions

### Can a website get my location without permission?

Not through the Geolocation API: the browser asks first, and a page that is refused gets a PERMISSION_DENIED error. A site can still estimate your location from your IP address, which needs no permission at all.

### How do I change my location in Chrome for testing?

Chrome DevTools has a Sensors panel that overrides the position for the open tab. It lasts while DevTools is open, so it suits testing a page rather than a browser you use every day.

### Is it suspicious to refuse location access?

No. Plenty of people click Block, and a page reads that as an ordinary denied permission. What stands out is a browser that answers once and then times out, or a position hundreds of kilometres from the IP.

### Does a VPN or proxy change my GPS location?

No. A proxy changes the IP a site sees. The Geolocation API answers from the operating system's location services, so it has to be changed separately or it will contradict the proxy.

## Related

[Browser fingerprinting: how sites recognise a browser without cookies](https://mosaicbrowser.com/glossary/browser-fingerprinting): Browser fingerprinting is recognising a browser by reading its hardware, settings and rendering quirks instead of storing a cookie. How sites do it.

[Match browser timezone to proxy IPs, automatically](https://mosaicbrowser.com/features/exit-matching): No need to match browser timezone to proxy by hand: Mosaic sets each profile's timezone, language and location from the measured IP, before every launch.

[Browser timezone does not match IP: what it means and the fix](https://mosaicbrowser.com/guides/browser-timezone-does-not-match-ip): Browser timezone does not match IP? Your browser reads the computer's clock, and a proxy or VPN moves only the address. Match the zone to the IP.

[WebRTC leak: when a page finds the address behind your proxy](https://mosaicbrowser.com/glossary/webrtc-leak): A WebRTC leak is a page learning your real IP address through WebRTC's STUN requests, which can go around a proxy or VPN instead of through it.





[IP geolocation: how a site knows roughly where you are](https://mosaicbrowser.com/glossary/ip-geolocation): IP geolocation maps an IP address to a country and city using registry records and published geofeeds. The country is usually right; the city is rough.



[Pixelscan says proxy detected: what it means and what to check](https://mosaicbrowser.com/guides/pixelscan-proxy-detected): Pixelscan's proxy detected card reads your public IP against the browser's timezone and language. A datacentre range or a listed address needs another IP.

[How to change the timezone in Chrome, and keep it on the IP](https://mosaicbrowser.com/guides/change-timezone-in-chrome): How to change the timezone in Chrome: it uses your computer's, so change the system zone, override one tab, or set it from Playwright or Puppeteer.

## See geolocation API spoofing on a real profile

Mosaic shows the values a site reads, per profile, and runs a leak test from inside the profile’s own page. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
