Actually the bug linked described the intended behavior; the actual bug is https://bugs.chromium.org/p/chromium/issues/detail?id=967656&q=localhost%20zoom&can=1 which appears to have been incorrectly closed as a duplicate (of a bug which makes no mention of port numbers). Prior to ~2019 tabs on different localhost ports did not share zoom levels (I don’t recall whether there was a shared zoom level per port, or if it just didn’t share zoom levels between localhost tabs at all).
I think you’re probably right about the CORS; I was inferring from the tab-zoom bug (which I did verify) to some speculations about other parts of origin handling (which I didn’t verify).
When I go to localhost:1234 (a port number with nothing on it, the error page looks like this (note the localhost with no port number). (The port number is still in the address bar though.)
That’s not correct: the port is always part of the origin, even on localhost. You can verify this:
And then in two terminals:
If you visit
http://localhost:8081/outer.html
and open the console you’ll see:While if you visit
http://localhost:8081/outer.html
you’ll see “hello world”.What’s happening with zooming is that saved zoom settings are keyed by
domain
notorigin
: it always ignores the port, not just on localhost. See https://bugs.chromium.org/p/chromium/issues/detail?id=33311 and the issues that have been merged into it.That’s not what I’m seeing; I see the port included in the URL on error pages both on localhost and not.
Actually the bug linked described the intended behavior; the actual bug is https://bugs.chromium.org/p/chromium/issues/detail?id=967656&q=localhost%20zoom&can=1 which appears to have been incorrectly closed as a duplicate (of a bug which makes no mention of port numbers). Prior to ~2019 tabs on different localhost ports did not share zoom levels (I don’t recall whether there was a shared zoom level per port, or if it just didn’t share zoom levels between localhost tabs at all).
I think you’re probably right about the CORS; I was inferring from the tab-zoom bug (which I did verify) to some speculations about other parts of origin handling (which I didn’t verify).
When I go to
localhost:1234
(a port number with nothing on it, the error page looks like this (note thelocalhost
with no port number). (The port number is still in the address bar though.)