Readonly
asciiThe URI host with an ASCII compatible encoding. Follows the IDNA draft spec for converting internationalized domain names (UTF-8) to ASCII for compatibility with existing internet infrasture.
Readonly
asciiThe host:port (or simply the host, if port == -1), with an ASCII compatible encoding. Host portion follows the IDNA draft spec. The result is strictly ASCII.
Readonly
asciiAdditional attributes: The URI spec with an ASCII compatible encoding. Host portion follows the IDNA draft spec. Other parts are URL-escaped per the rules of RFC2396. The result is strictly ASCII.
Readonly
displayIf the URI has a punycode encoded hostname, this will hold the UTF8 representation of that hostname (if that representation doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false) Otherwise, if the hostname is ASCII, it will return the same as .asciiHost
Readonly
displayThe displayHost:port (or simply the displayHost, if port == -1).
Readonly
displayReturns the same as calling .prePath, only with a UTF8 encoded hostname (if that hostname doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false)
Readonly
displayReturns the same as calling .spec, only with a UTF8 encoded hostname (if that hostname doesn't contain blacklisted characters, and the network.IDN_show_punycode pref is false)
Readonly
fileAdditional attributes added for .query support: Returns a path including the directory and file portions of a URL. For example, the filePath of "http://host/foo/bar.html#baz" is "/foo/bar.html".
Some characters may be escaped.
Readonly
hasReturns if there is a reference portion (the part after the "#") of the URI.
Readonly
hostThe host is the internet domain name to which this URI refers. It could be an IPv4 (or IPv6) address literal. Otherwise it is an ASCII or punycode encoded string.
Readonly
hostThe host:port (or simply the host, if port == -1).
Readonly
passwordReadonly
pathThe path, typically including at least a leading '/' (but may also be empty, depending on the protocol).
Some characters may be escaped.
This attribute contains query and ref parts for historical reasons. Use the 'filePath' attribute if you do not want those parts included.
Readonly
portA port value of -1 corresponds to the protocol's default port (eg. -1 implies port 80 for http URIs).
Readonly
preThe prePath (eg. scheme://user:password@host:port) returns the string before the path. This is useful for authentication or managing sessions.
Some characters may be escaped.
Readonly
queryReturns the query portion (the part after the "?") of the URL. If there isn't one, an empty string is returned.
Some characters may be escaped.
Readonly
refAdditional attribute & methods added for .ref support: Returns the reference portion (the part after the "#") of the URI. If there isn't one, an empty string is returned.
Some characters may be escaped.
Readonly
schemeThe Scheme is the protocol to which this URI refers. The scheme is restricted to the US-ASCII charset per RFC3986.
Readonly
specThe URI is broken down into the following principal components: Returns a string representation of the URI.
Some characters may be escaped.
Readonly
specreturns a string for the current URI with the ref element cleared.
Readonly
userThe username:password (or username only if value doesn't contain a ':')
Some characters may be escaped.
Readonly
usernameThe optional username and password, assuming the preHost consists of username:password.
Some characters may be escaped.
Optional
aInstancePtr: objectA run time mechanism for interface discovery.
NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.
aInstancePtr must not be null.
[in] A requested interface IID
[out] A pointer to an interface pointer to receive the result.
URI equivalence test (not a strict string comparison), ignoring the value of the .ref member.
eg. http://foo.com/# == http://foo.com/ http://foo.com/#aaa == http://foo.com/#bbb
Generated using TypeDoc
nsIURI - interface for an uniform resource identifier w/ i18n support.
AUTF8String attributes may contain unescaped UTF-8 characters. Consumers should be careful to escape the UTF-8 strings as necessary, but should always try to "display" the UTF-8 version as provided by this interface.
AUTF8String attributes may also contain escaped characters.
Unescaping URI segments is unadvised unless there is intimate knowledge of the underlying charset or there is no plan to display (or otherwise enforce a charset on) the resulting URI substring.
The correct way to create an nsIURI from a string is via nsIIOService.newURI.
NOTE: nsBinaryInputStream::ReadObject contains a hackaround to intercept the old (pre-gecko6) nsIURI IID and swap in the current IID instead, in order for sessionstore to work after an upgrade. If this IID is revved further, we will need to add additional checks there for all intermediate IIDs, until ContentPrincipal is fixed to serialize its URIs as nsISupports (bug 662693).