Geolocation permission denied Browser Origin: On your device Last updated 15 Oct 2026

Console: User denied Geolocation / Only secure origins are allowed (geolocation) / GeolocationPositionError code 1

navigator.geolocation failed because the user blocked location, the page is not on HTTPS, or the OS has location services off.

Exact message you may see User denied GeolocationOnly secure origins are allowed (see: https://goo.gl/Y0ZkNV)PERMISSION_DENIED geolocationGeolocation permission has been blocked
Seen on: Chrome Firefox Safari JavaScript

Meaning

The error object has a code: 1 PERMISSION_DENIED, 2 POSITION_UNAVAILABLE, 3 TIMEOUT. Chrome and others require a secure context for geolocation. Permission is remembered per site, so a past "Block" keeps failing until reset.

Common causes

  • User clicked Block (saved for the site)
  • Page served over HTTP, or an iframe without allow="geolocation"
  • OS location services disabled for the browser
  • Position unavailable indoors / no GPS or Wi-Fi data (code 2)
  • Timeout too short (code 3)

⚡ Quick fix

  1. Serve the page over HTTPS and ask after a user action
  2. Reset the site permission (lock icon → Site settings → Location)
  3. Enable system location services for the browser

Detailed fix by platform

JavaScript

  1. navigator.geolocation.getCurrentPosition(ok, err => console.log(err.code, err.message), { enableHighAccuracy: false, timeout: 10000 })

Windows

  1. Settings → Privacy & security → Location → on, and allow desktop apps

macOS

  1. System Settings → Privacy & Security → Location Services → browser on

How to diagnose

  1. Code — GeolocationPositionError code 1, 2 or 3?
  2. Context — HTTPS?
  3. OS — Location services on?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Aw, Snap! — Chrome: Aw, Snap! Something went wrong while displaying this webpage. Error code: STATUS_ACCESS_VIOLATION / SIGILL / Out of Memory (Browser)Aw, Snap!captive portal — Browser: This network requires you to sign in — captive portal (hotel, airport, café Wi-Fi) blocking HTTPS sites (Browser)captive portalclipboard write blocked — NotAllowedError: Failed to execute 'writeText' on 'Clipboard': Document is not focused. (JavaScript)clipboard write block…NotAllowedError: Permission denied — Console: NotAllowedError: Permission denied (getUserMedia — camera or microphone blocked) (Browser)NotAllowedError: Perm…Permissions policy violation — Console: [Violation] Permissions policy violation: camera is not allowed in this document (Feature-Policy) (Browser)Permissions policy vi…The canvas has been tainted by cross-origin data — Console: SecurityError: Failed to execute 'toDataURL' / 'getImageData' on 'HTMLCanvasElement': Tainted canvases may not be exported (Browser)The canvas has been t…Unchecked runtime.lastError — Console: Unchecked runtime.lastError: The message port closed before a response was received (extension message) (Browser)Unchecked runtime.las…Geolocati…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.