HTML <geolocation> element
A browser-drawn button that asks for location; the click itself is the request.
In one line
Can show a browser made button that asks for your location when you tap it
A browser-drawn button that asks for location; the click itself is the request.
Same data as Geolocation, but the request starts from a trusted button the site cannot disguise, so prompts only appear when the person asked. Chrome can also re-ask after a block.
What it can and can't do
What the user does: You tap the Use my location button drawn by the browser
It can
- Ask for your location when you tap the button
- Share your position again quietly if you already allowed it
- Offer a way to turn location back on if you blocked it
It cannot
- Ask in the background or without your tap
- Change the button's text or icon to trick you
- Work in Firefox or Safari
How it differs between platforms: Only Chrome and Edge have it so far. Firefox and Safari use the normal location prompt.
Browser support
| Browser | Status | First version | Released | Note |
|---|---|---|---|---|
| Chrome | Supported | 144 | 2026-01-13 | Developer blog 2026-01-13, generic <permission> element was an origin trial in Chrome 126 to 143 |
| Edge | Supported | 144 | 2026-01-21 | None |
| Firefox | Not supported | Not available | Not listed | None |
| Safari | Not supported | Not available | Not listed | None |
| Safari on iPhone | Not supported | Not available | Not listed | None |
| Chrome on Android | Supported | 144 | 2026-01-13 | None |
| Samsung Internet | Not supported | Not available | Not listed | None |
How a site asks for it
| API | <geolocation autolocate accuracymode="precise|approximate" watch onlocation=...>; element.position, element.error |
| Permission name | geolocation |
| Permissions policy | geolocation |
| Browser compat keys | api.HTMLGeolocationElement |
| How access is granted | prompt |
| What the user sees | Browser-drawn button with fixed text and icon; a click opens the normal location prompt, re-reads silently if already granted, and offers a recovery path if blocked. |
| Needs a secure context (HTTPS) | Yes |
| Needs a user gesture | Yes |
| How long it lasts | Same stored geolocation permission as the script API |
| How to take it back | Same as Geolocation; element matches :granted |
| Inside an iframe | Needs allow="geolocation" in cross-origin iframes |
Typical flow
- Add <geolocation> to the page
- Person clicks the browser-drawn button
- Browser runs the permission flow
- location event fires; read element.position or element.error
Data you get
What comes back: GeolocationPosition delivered through an element
Shape: object
How often: one-shot, or continuous with the watch attribute
| Field | Type | Unit | Range | Precision |
|---|---|---|---|---|
autolocate | boolean attribute | none | present or absent | only reuses an existing grant, never prompts on load |
accuracymode | enum attribute | none | precise or approximate | maps to enableHighAccuracy |
position | object | GeolocationPosition | same as navigator.geolocation | same |
style contrast | rule | ratio | about 3:1 minimum | browser refuses low-contrast or disguised styling |
Technical limits
- Cannot be restyled to hide or disguise it (contrast, opacity, size, transform checks)
- autolocate cannot trigger a prompt
- Not in Firefox or Safari: feature detect with 'HTMLGeolocationElement' in window
The story
What it is
A button the browser draws that asks for location, so your click is the request.
For you
You see a button such as 'Use my location' that looks like part of your browser. You press it and the browser asks once. Because you clicked it yourself, there is less chance of a pop up scam.
For makers
Makers get more yes answers because people trust a clear browser button. It avoids ugly pop ups that people block by reflex, which helps maps, delivery and booking funnels.
Where you see it
| Type | Example | Apps |
|---|---|---|
| maps | A store locator shows a 'Use my location' button that finds the nearest shop. | Starbucks, Walmart |
| delivery | A food order page uses the button so an address is filled in with one click. | DoorDash, Domino's |
| travel | A hotel search page uses it to show stays nearby. | Booking.com |
| games | A location based web game shows a 'Start playing here' button that unlocks nearby quests. | None named |
| rideshare | A ride web page sets pickup using the button. | Uber |
| security | The trusted button makes it harder for a fake page to trick people into a hidden location request. | None named |
Risks
- Still shares real location
- New feature, not everywhere
What the platform says
- Google Chrome: HTML geolocation element. Chrome describes a built in button for location so people can grant access with one clear click and sites avoid pop up fatigue.
Good uses and abuse
Legitimate uses
- Higher grant rates from clear intent (Immobiliare.it reported +20% successful flows)
- Recovery after a block (ZapImoveis reported 54.4%)
Known abuse
- Pushing the element everywhere to harvest location
Scores
| Score | Value | Meaning |
|---|---|---|
| Sensitivity | 5 of 5 | How revealing the data is |
| Utility | 4 of 5 | How useful it is to honest apps |
| Friction | 1 of 5 | How much the user has to do |
| Fingerprint bits | Not rated | Rough identifying entropy, when known |
History
- 2024-06, Chrome 126: Generic <permission> element origin trial begins
- 2026-01, Chrome 144: <geolocation> available
- 2026-06, Chrome 151: Sister element <usermedia> for camera and microphone announced as available
Related capabilities
Related
- Geolocation. Can find where your device is, once or while the page is open
- HTML <usermedia> element (camera and microphone). Can ask for camera or microphone through a button the browser draws itself
Sources
How well checked: Checked against real behavior.