Site keeps asking for permission to enable geolocation

I’m working on site locally and it uses geolocation to track users locally. Even after allowing geolocation in the browser, it still prompts me to allow it. I went into the settings and changed location to “always allow” and it still asks for permission. Is it because I’m developing locally? I’m working with just the front end (server isn’t up yet) so I’m using the HTML file.

Are you opening it from a ‘file’ url, or serving it to yourself? If the former, try the latter. It’s really simple to run a local server. I usually use either the python server built into macos or the npm ‘http-server’ package (installed globally) but there are lots of alternatives, including simple desktop apps. Lots of things only work right if you are going over http/s.

This worked!! Thanks a lot, I installed the http-server, got it up and running, and it only prompted me once to enable geolocation. After some reading it seems that the latest versions of Chome and Safari will not allow geolocation over insecure origins.