Geolocation from local html-file stopped working in evening and morning


Yesterday my weather-page, loaded as a file (file:///FreeCodeCamp/weather-today/weather.html), worked fine.
But this morning I get the error back from my js-script: Location not available.

I tried the page from w3schools and that also returns “location not available”.

I tried both Firefox and Chrome but both fail today.

Is it possible that this service is down? Is it possible to see a notification of the service-supplier if a service is down?

Can you post all of your code (or at least html and JavaScript), so we can examine your code and attempt to debug it?

Oke, I will create a new codepen. Takes a few minutes.

You can just post the code in a forum reply if you want.

I had to create the codepen anyway :).

Here is the codepen weather

There is no CSS (work in progress).

Your code works for my location. I ran your code on Codepen and on my local pc and both worked with Chrome. What browser are you using when you get this message? What browser were you using when it worked?

Are you getting the “location not available” shown in the console?

My console shows:

func initPage|                                       weather.js:6:5
func retrieveWeatherForecast|                        weather.js:13:5
func geoError|               (!!!)                   weather.js:27:5

The HTML-page says:
Location information is unavailable.

When displaying on “codepen” I get the same message.

I was using both browsers yesterday and this morning:
Firefox: Quantum 58.0.2 on Linux
Chrome: 64.0.3282.140 (Official Build) Built on Ubuntu , running on Ubuntu 17.10 (64-bit)

But if it is working on your location …
I will reset my modem to see if that helps.

Nope, did not help

I searched google on same issue but cannot find related articles.

I have found a solution:
In about:config (Firefox) I changed the value of GEO.WIFI.URI

Now it works again. I have no clue however what has happened. Why is the google-uri suddenly malfunctioning?

Can somebody reply on this and show me which URI he/she uses? I am curious if this is the real problem.

I just ran an update on the Ubuntu Linux software and now things are working again with the original URI.
Next time I must remember to do that first.

It sounds crazy but the geolocation-object (home laptop) is the past 3 days only functioning roughly between 12:00 pm and 19:00 pm.

I noticed that in the evening and morning the “permission dialog box” comes very fast back with the message “unknown error” (position.message). I think the browser did not even bother to make the request to google’s API.