DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk4 min

How to Test Geolocation in a Browser with Chrome DevTools

Use Chrome DevTools Sensors to simulate a location and test the success, permission, and failure paths of a browser geolocation feature.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To test how a website responds to location, override the browser’s geolocation in Chrome DevTools: open the Sensors panel, choose a preset or enter coordinates, then trigger the site’s location feature again. Also test denied permission, unavailable location, timeouts, and unsupported browsers. This simulates what the page receives from the browser; it does not change your IP address or test server-side IP geolocation.

Set a test location in Chrome DevTools

  1. Open the page you want to test in Chrome, then open DevTools.

  2. Open the Command Menu with Command+Shift+P on macOS, or Control+Shift+P on Windows, Linux, or ChromeOS.

  3. Type sensors, select Show Sensors, and press Enter.

    Free tools Windows power users keep installed

    One-click scans. No signup required.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  4. In the Sensors panel, find Geolocation. Choose a preset city, enter custom latitude and longitude, or select Location unavailable.

  5. Return to the page and repeat the normal user action that requests location. Check both the displayed result and the page’s fallback or error state.

Chrome documents preset cities, custom coordinates, and the unavailable-location option in its DevTools Sensors guide. A custom coordinate tests how the page handles the coordinates supplied by the browser; it does not establish that the coordinates match a real device or location.

Test the success path and ongoing updates

One-time location lookup

For a feature such as “find nearby,” test the user-triggered lookup that uses navigator.geolocation.getCurrentPosition(). Confirm that the page responds correctly to the selected location, including when the user initiates the request more than once.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Position changes

If the feature tracks movement or updates a geofence, test navigator.geolocation.watchPosition(). Change the DevTools override and confirm the interface handles updates as expected. Stop the watch with clearWatch() when the feature no longer needs it.

Test permission and failure states

  • Permission denied: Deny the browser prompt or use a previously denied permission state. Verify that the page explains what happened and offers a useful next step rather than silently failing.
  • Location unavailable: Choose Location unavailable in the Sensors panel. Check that the application presents its intended fallback.
  • Timeout: Exercise the page’s timeout handling. The W3C Geolocation specification identifies the timeout error code as 3 (TIMEOUT); verify the interface recovers or explains how to retry.
  • API unavailable: Feature-detect navigator.geolocation and confirm the page remains usable or explains the limitation if the API is absent.
  • Insecure page: Test over HTTPS. Geolocation is restricted to secure contexts; the W3C algorithm returns PERMISSION_DENIED for a non-secure context.
  • Device or OS location disabled: If browser permission is allowed but a request still fails, check the operating system’s location settings as well. Browser permission and system-level location availability are separate layers.

The W3C Geolocation specification describes the API’s permission and error behavior. The web.dev guide to user location recommends checking availability, handling errors, and providing a fallback.

Understand what the override does—and does not—test

The Geolocation API is a high-level browser interface. Its underlying location source can involve GPS, network signals, or user input, and the W3C specification does not guarantee that the returned location is the device’s actual location. A DevTools override is therefore useful for checking how a web page behaves when the browser exposes chosen coordinates.

It does not change the visitor’s network address or verify an IP-based location decision made by your server, CDN, or an external service. Test IP geolocation separately if your product relies on it; IP-derived estimates can be inaccurate, particularly when a VPN or proxy is involved, as web.dev notes. These steps describe Chrome DevTools; current equivalent override workflows for Firefox, Safari, and Edge are not established here, so verify behavior in the browsers and operating systems your product supports.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make the permission request understandable

The W3C specification states: “Geolocation is a powerful feature that requires express permission from an end-user before any location data is shared with a web application.” Test the prompt as part of the user experience, not just the successful coordinate response.

  • Ask for location in response to a clear user action, and explain why the feature needs it.
  • Check that the page detects whether the API is available and provides a useful alternative when it is not.
  • Explain permission denial or other errors without trapping the user in a dead end.
  • Request location only when necessary, use it for the stated task, protect it, and disclose collection and retention practices, as advised by the W3C specification.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. It can capture a page after removing supported cookie and consent banners, newsletter popups, and chat widgets. It does not override browser geolocation: use Chrome DevTools above when you need to test the Geolocation API or its permission states. For a screenshot of a page, one GET request returns an image or PDF. See the ScreenshotNeo API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, popups, and chat widgets before the shot; bot checks, blank pages, and failed loads are never billed. Its MCP server lets AI agents take screenshots, and the free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

Frequently Asked Questions

Does changing the Chrome DevTools location change my IP address?

No. The override supplies location coordinates to the browser page; it does not change network-based location signals.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Can I use this to test a location-based feature without allowing real location access?

Yes. Use a DevTools preset or custom coordinates to test the page’s browser-level response, and separately test the permission prompt and denied state.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
Recommended PC Tool
Recommended PC Tool
Windows Errors? Fix Them Before They SpreadFree repair scan
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.