In trying to help the OP, I discovered my solution suddenly no longer working either, in any browser on my laptop. Specifically geolocation isn’t functioning correctly.
I’m on win 10. I only mention because in checking all of my settings (on a system where geolocation worked fine up until this point, and settings weren’t changed) I decided to make sure browsers could access location explicitly in windows settings, but there was only an option to allow microsoft edge, not chrome or firefox.
Upon allowing edge, both my solution and the OPs worked, in edge only.
not that im suggesting anything nefarious on windows part…just wondering if its some quirk of a recent update
edit: Seems it was just a temporary chrome problem, works fine now.(and my firefox version was out of date)