It would be useful for nsIURI to include an attribute containing the effective TLD (per the effective TLD service) for the host in the URI. For example, if nsIURI::host was www.bbc.co.uk, then nsIURI::effectiveTLD (or the like) would be co.uk. It's not particularly hard to obtain this data separately. One just needs to pass the host to nsIEffectiveTLDService::getEffectiveTLDLength() and then extract a substring of the host based on the value returned by that method. But it would be convenient for this to happen in a getter on nsIURI. And it seems to fit conceptually with the other attributes on that interface that contain portions of the URI (or portions of portions, as with username and password, which contain portions of userPass).
pick a different interface unless you are proposing that nsIURI be unfrozen.
(In reply to comment #1) > pick a different interface unless you are proposing that nsIURI be unfrozen. I can't think of another interface that would be more appropo (except possibly a new interface), so I guess I am proposing that nsIURI be unfrozen.
hm... there can be a lot of nsIURI implementations... all of them would need to implement this, and it would be all the same way. why not add a function to nsIEffectiveTLDService that returns the string, instead of just its length?