make top-level-domain an attribute of nsIURI interface

RESOLVED WONTFIX

Status

()

Core
Networking
--
enhancement
RESOLVED WONTFIX
11 years ago
2 years ago

People

(Reporter: myk, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

11 years ago
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).

Comment 1

11 years ago
pick a different interface unless you are proposing that nsIURI be unfrozen.
(Reporter)

Comment 2

11 years ago
(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?
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.