You are not logged in.

#1 2021-05-01 15:49:28

no-cheating
Member
From: Poland
Registered: 2016-04-26
Posts: 61

[SOLVED] Firefox problems with resolving localhost

When I try to open localhost:4200 URL in Firefox Developer Edition (version 89.0b6) Firefox doesn't load the page, but I'm presented with Choose an application to open the localhost link dialog. If I add the protocol name and enter http://localhost:4200 it opens it fine.

I have 127.0.0.1 localhost line in /etc/hosts. Also Chromium opens localhost:4200 without issues.

Does anyone know why Firefox behaves like this and how to fix it?

Last edited by no-cheating (2021-05-01 16:35:20)

Offline

#2 2021-05-01 16:14:29

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [SOLVED] Firefox problems with resolving localhost

This isn't a localhost resolution problem - firefox simply doesn't guess a scheme for the present pattern.
There's no standard for that, so they're not doing it "wrong" either.

The proper url is "http://localhost:4200/" - everything else means that the browser must make an assumption about what you actually wanted to enter (incl. the trailing slash)
Eg. "www.localhost:4200" or "localhost:8080" or "localhost:631" might lead to http assumptions because of the present pattern, but 4200 isn't a commonly used port and could just as much be ssh, ftp, file, smb, …

There're apparently keys in about:config, "browser.fixup.*" but idk whether they're relevant in your case.

Offline

#3 2021-05-01 16:35:02

no-cheating
Member
From: Poland
Registered: 2016-04-26
Posts: 61

Re: [SOLVED] Firefox problems with resolving localhost

I understand. Thanks for the explanations. Everything sounds reasonable, so I'll better just start adding protocol to it each time.

Offline

Board footer

Powered by FluxBB