It’s All About The Permissions Recovery

HTML has a <geolocation> element now. While it’s only supported in Chrome’n’friends for now, it’s progressive-enhancement-able. I covered it in our 2026 HTML article and also blogged about its interesting enforced accessibility.

But the most interesting story about this element is: permissions recovery.

Mostly meaning: you said no, but now you wanna say yes.

Here’s a demo that you should probably open as a full-page preview.

A Non-Supporting Browser

Let’s walk through clicking the button to do geolocation in Firefox.

Firefox doesn’t support <geolocation>, so the fallback kicks in (i.e., call navigator.geolocation.getCurrentPosition() and see what happens) and we get this by default:

This is what permissions is.

Geolocation is sensitive information and you should only do it if you feel safe doing it.

Say I click Block.

In that case, no geolocation is done.

If I click it again, it will ask again. That’s fine/good.

But notice I can remember this choice.

Now what?

Now, when I press this button, from now until the end of time (in this browser), the request will be denied. That’s also maybe fine/good. But not all websites remind you that you’ve done this. In fact, I’d wager that most of them just silently fail. You try to use a feature like this, it just doesn’t work.

If you ever want to recover from this choice and allow geolocation, you’ve got to:

  1. Find/open the browser settings
  2. Go to the Permissions and data area
  3. Choose location
  4. Find the exact website you want to change your mind about
  5. Adjust the permission there or delete the record to let the site try again

It’s absolutely possible, and some users will know that. I’d also wager that most don’t/won’t.

A Supporting Browser

Let’s do that same thing in Chrome, which is first out of the gate for supporting <geolocation>.

The button looks a bit different. Note the “precise” language comes from using the accuracymode="precise" attribute.

We are still asked when we press it.

The choices are interesting here. There is no block option at all. It’s just essentially “allow forever” or “allow once”. While that feels weird, it’s kind of the point here. The <geolocation> element either:

  1. Works
  2. Asks

I can just close this prompt here, which disallows the geolocation. And I do actually have a mechanism for blocking.

If it works, it works. If it doesn’t, at least you know why (you didn’t allow it just moments ago).

No More Mystery

I like that it’s easier to “recover” from a blocked state, as it’s confusing as heck when features just don’t work when you expect them to. From Chrome’s announcement post, they feature some data, including:

ZapImóveis observed a 54.4% success rate in users recovering from a “previously blocked” state when presented with the element.

Seems good.

I imagine this is even more important with <usermedia> for camera and microphone access, which essentially works the same way.

Looking for a complete course on getting into web development?

Leave a Reply

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

$966,000

Master.dev donates to open source projects through thanks.dev and Open Collective, as well as donates to non-profits like The Last Mile, Annie Canons, and Vets Who Code.