single label hosts (localhost) shown/whitelisted with scheme
single label hosts (localhost) shown/whitelisted with scheme
http://localhost instead of just localhost, why?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Re: single label hosts (localhost) shown/whitelisted with sc
Ns 2.0.2.1
Code: Select all
<html>
<head>
<script>
function evHandler(e)
{
dump(e.type + '\n');
}
function writeFrame()
{
var w = document.getElementById('child').contentWindow;
w.document.open();
w.addEventListener('load', evHandler, false);
w.addEventListener('DOMContentLoaded', evHandler, false);
w.document.write('doc.written');
w.document.close();
}
</script>
</head>
<body>
<button onclick="writeFrame();">write frame</button>
<iframe id="child"></iframe>
</body>
</html>
- load the above page on localhost
- allow "http://localhost"
- write frame
- forbid localhost
- after refresh, the NS menu contains ( "localhost" "http://localhost" "wyciwyg://localhost" )
- expected behavior: at all times, in every state, the menu should show only a single entry "localhost" (and without the scheme)
Last edited by al_9x on Thu Sep 16, 2010 9:13 am, edited 1 time in total.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8
Re: single label hosts (localhost) shown/whitelisted with sc
Code: Select all
<script src="http://localhost:81/"></script>
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
- Giorgio Maone
- Site Admin
- Posts: 9524
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: single label hosts (localhost) shown/whitelisted with sc
These are all glitches due to CAPS implementation details: if a domain contains no dots, it needs the protocol to be specified in order to match.
Of course cosmetic changes can be done in order to make the UI less confusing and CAPS disappear in the background as much as possible, but here's the reason you're asking for.
Of course cosmetic changes can be done in order to make the UI less confusing and CAPS disappear in the background as much as possible, but here's the reason you're asking for.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9
Re: single label hosts (localhost) shown/whitelisted with sc
CAPS is an implementation detail as you mentioned, it does not dictate what you show in the menu, that's entirely up to you.Giorgio Maone wrote:These are all glitches due to CAPS implementation details: if a domain contains no dots, it needs the protocol to be specified in order to match.
Of course cosmetic changes can be done in order to make the UI less confusing and CAPS disappear in the background as much as possible, but here's the reason you're asking for.
there are three specific separate glitches/bugs here, can you a) repro them all? b) put them on your todo?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
- Giorgio Maone
- Site Admin
- Posts: 9524
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: single label hosts (localhost) shown/whitelisted with sc
I consider the double http://localhost entry a bug in need to be fixed ASAP.
The other ones are in my TODO list, but low priority because they touch an area which already contain many hacks and moving parts to address the implementation mismatches I hinted you about earlier, and therefore are to be touched with extreme care.
The other ones are in my TODO list, but low priority because they touch an area which already contain many hacks and moving parts to address the implementation mismatches I hinted you about earlier, and therefore are to be touched with extreme care.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
- Giorgio Maone
- Site Admin
- Posts: 9524
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: single label hosts (localhost) shown/whitelisted with sc
Forgot to tell: there's a very good reason why http://localhost is shown instead of localhost for "Allow" commands: the browser has currently no way to tell whether localhost (or any other 1 component domain name) is a public internet suffix (TLD) or an arbitrary internal domain name, because nsIEffectiveTLDService.getPublicSuffix() returns the string itself both for "localhost" and for "com".
At this point, why NoScript doesn't display an "Allow localhost" command is quite obvious, isn't it?
At this point, why NoScript doesn't display an "Allow localhost" command is quite obvious, isn't it?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
- Giorgio Maone
- Site Admin
- Posts: 9524
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: single label hosts (localhost) shown/whitelisted with sc
The issues would could reasonably be worked-around have been in latest development build.
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Re: single label hosts (localhost) shown/whitelisted with sc
These are implementation details, what you show in the menu is under your control, and need not impact what happens behind the scenes. If "full addresses" is not set, you should show "localhost" in the menu, how it appears in the whitelist is a different story.Giorgio Maone wrote:Forgot to tell: there's a very good reason why http://localhost is shown instead of localhost for "Allow" commands: the browser has currently no way to tell whether localhost (or any other 1 component domain name) is a public internet suffix (TLD) or an arbitrary internal domain name, because nsIEffectiveTLDService.getPublicSuffix() returns the string itself both for "localhost" and for "com".
At this point, why NoScript doesn't display an "Allow localhost" command is quite obvious, isn't it?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
- Giorgio Maone
- Site Admin
- Posts: 9524
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: single label hosts (localhost) shown/whitelisted with sc
If I show "localhost", I must show "com" or "org" as well.al_9x wrote:These are implementation details, what you show in the menu is under your control, and need not impact what happens behind the scenes. If "full addresses" is not set, you should show "localhost" in the menu, how it appears in the whitelist is a different story.Giorgio Maone wrote:Forgot to tell: there's a very good reason why http://localhost is shown instead of localhost for "Allow" commands: the browser has currently no way to tell whether localhost (or any other 1 component domain name) is a public internet suffix (TLD) or an arbitrary internal domain name, because nsIEffectiveTLDService.getPublicSuffix() returns the string itself both for "localhost" and for "com".
At this point, why NoScript doesn't display an "Allow localhost" command is quite obvious, isn't it?
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Re: single label hosts (localhost) shown/whitelisted with sc
http://localhost duplication is still thereGiorgio Maone wrote:The issues would could reasonably be worked-around have been in latest development build.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Re: single label hosts (localhost) shown/whitelisted with sc
Why must you? I don't understand the difficulty, this is just a question of presentation. I am not asking you to change any underlying behavior, just how single label domains are displayed in the menu.Giorgio Maone wrote:If I show "localhost", I must show "com" or "org" as well.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
- Giorgio Maone
- Site Admin
- Posts: 9524
- Joined: Wed Mar 18, 2009 11:22 pm
- Location: Palermo - Italy
- Contact:
Re: single label hosts (localhost) shown/whitelisted with sc
Because there's no way to tell "localhost" apart of "com", "org", "net" and so on.al_9x wrote:Why must you?Giorgio Maone wrote:If I show "localhost", I must show "com" or "org" as well.
Therefore if a page has something like
Code: Select all
<script src="http://com/fake.js"></script>
<script src="http://localhost/some-script.js"></script>
Code: Select all
Allow http://com
Allow http://localhost
Code: Select all
Allow com
Allow localhost
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Re: single label hosts (localhost) shown/whitelisted with sc
ok got it you don't want to imply that you are allowing the whole tld for the edge case that the host name matches a tld, well the tld list is well defined http://data.iana.org/TLD/tlds-alpha-by-domain.txt you can make exceptions for themGiorgio Maone wrote:Because there's no way to tell "localhost" apart of "com", "org", "net" and so on.al_9x wrote:Why must you?Giorgio Maone wrote:If I show "localhost", I must show "com" or "org" as well.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
Re: single label hosts (localhost) shown/whitelisted with sc
And what if new TLDs get added?
IMHO, Giorgio should rather treat all TLDs as potentially valid, except the ones specifically mentioned in RFC 2606:
IMHO, Giorgio should rather treat all TLDs as potentially valid, except the ones specifically mentioned in RFC 2606:
- example
- invalid
- localhost
- test
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.9) Gecko/20100824 Firefox/3.6.9